Fire crews were called to the blaze at Cakemuir Gardens, in the Niddrie area of Edinburgh, at about 1.30am.
An 18-year-old man and a woman, 20, were given oxygen before being taken by ambulance to the city’s Royal Infirmary.
Both were said to be suffering from smoke inhalation.
A spokeswoman for Lothian and Borders Fire and Rescue Service said the fire started when candles were left unattended in a bedroom. She added that firefighters wore breathing apparatus to extinguish the blaze.
Meanwhile, at 2.20am, fire crews were called to Saughton Mains Place, also Edinburgh, where a fire had started after a pan of food was left unattended.
A woman from the flat and her male neighbour were being treated at the scene by ambulance staff when fire crews arrived.
They were both taken to the Royal Infirmary of Edinburgh for precautionary checks.
A fire service spokeswoman said there had been smoke and fire damage to the kitchen.