More than 20 people were left homeless on Tuesday after an early morning apartment fire in Fredericton.

The 12-unit building on York Street in the capital city's downtown area caught fire around 2 a.m.

Megan Young and Edward Jones said a fire alarm woke them up and when they got outside they noticed the back corner of the building was on fire. Their basement apartment escaped the worst of the damage.

They spent the night at a relative's house as fire crews tried to put out the blaze. They returned Tuesday to assess the damage.

"Today it looks a lot worse," Jones said.

The entire top floor of the building was gutted.

"The big thing was there was so much attic space that allowed the fire to travel," said Bob Martin, assistant deputy fire chief.

"So we called a second alarm in, brought in additional vehicles, used a lot of our aerials because it was above the third floor, almost in the fourth floor."

The Red Cross is providing accommodations to residents who have nowhere to stay.

Martin said the building is structurally sound. It will now be up to the building manager to decide when residents can enter and hopefully salvage some of their belongings.