Police were alerted to the grim discovery on Friday morning at the property on Dumbiedykes Road following a report of concern for occupants.
It is understood the corpse - which is in such an advanced state of decomposition that gender details have not yet been released - was found beneath blankets and a television by two people who were locked in the flat.
A police source speaking to the Daily Record said the rundown property is a well-known drugs den and that the two people locked inside had been told not to look in the bedroom where the corpse was found.
In an official statement, Police Scotland said: “Police in Edinburgh responded to an address in Dumbiedykes Road at around 7am on Friday, April 19, following a report of concern for the occupants.
“On arrival, officers found the body of a person within and this death is currently being treated as unexplained.
“Inquiries are ongoing and a report will be submitted to the Procurator Fiscal.”
Police added that a previous call was made to the address on 30 January.
Sign up to our newsletter: enter your email in the box at the top of this article to get daily updates straight to your inbox.