Emergency services were called to the scene in Menzies Court, Perth, at around 2.40am on Friday.
Four fire engines went to the scene and crews extinguished the blaze.
Firefighters helped 14 people out of the building and they were passed into the care of the Scottish Ambulance Service and taken to hospital.
Incident manager Graham Smart said: "Operations control mobilised four fire appliances to the scene and firefighters wearing breathing apparatus extinguished the flames.
"Crews assisted 14 people from the building."
He added: "Crews left the scene at 5.35am after ensuring the area was made safe."