A passing police officer raised the alarm after he spotted smoke coming from the building.
Firefighters rescued two men, aged 37 and 64, from the second-floor flat in Restalrig Road, but the 37-year-old was pronounced dead at the
The 64-year-old was taken to Edinburgh Royal Infirmary suffering from chest pains and the effects of smoke.
The flat was badly damaged in the blaze. Investigators are trying to discover the cause of the fire, but it is not bring treated as suspicious. A spokeswoman for Lothian and Borders Fire and Rescue Service said it was lucky the alarm had been raised when it was.
She said: “if it had not been for the police officer passing by, we believe it could have been even worse.”
Lothian and Borders Police said: “Police responded to a fire in Restalrig Road at 4am this morning.
“A 37-year-old man died at the scene and a 64-year-old man has been taken to hospital. Investigations are at an early stage to establish the cause of the fire.”