Two men are dead after a fire broke out at a rooming house in Kensington Market early Thursday morning, Toronto police say.

As many as 12 people, including two young children, were rescued from the three-storey building when emergency personnel arrived at the chaotic scene on St. Andrew Street, west of Spadina Avenue, at about 2 a.m.

Police officers rescued an unconscious woman and a child before fire crews arrived, and some of the occupants were trapped on the upper floors and had to be rescued with a ladder, a fire official told CP24.

Toronto EMS spokeswoman Kim McKinnon said paramedics transported 12 people to different hospitals.

The two men were pronounced dead and McKinnon said the others were being treated for non-life-threatening injuries related to smoke inhalation.

A family of six was among those hospitalized.

Fire officials said it appears the three-alarm blaze began on the second floor and then spread to other parts of the three-storey building as the residents were asleep.

The building has restaurants on the ground floor and a cluster of small apartments on the upper floors. The apartments all share a common kitchen and bathroom, a fire official said.

The building is equipped with smoke detectors but investigators have not confirmed whether they were functioning.

The cause of the blaze is under investigation.

The address was not licensed to operate as a rooming house and there is no record of active inspections at the location, a city spokesperson told CP24 in an email Thursday.

At least 5 killed in Toronto fires this month

March has been a deadly month for fires in Toronto.

Three people died after a fire broke out in an apartment above a vacant store on Dovercourt Road, near Dupont Street, on March 7.

Lonnie Schubert, an investigator with the Office of the Fire Marshal, urged people to check their smoke detectors to make sure they are working properly.

“Operating smoke alarms that are checked on a regular basis certainly do save people’s lives,” Schubert said at the scene of Thursday’s fatal fire. “We see this on a continual basis.”

People should have a fire escape route that includes a pre-arranged meeting place once the occupants get outside, he said.

Schubert said fire crews were called to a number of fires where people heated their homes improperly during the unusually cold winter.

He said people should use heaters that are safe and appropriate for indoor use, and he urged people not to leave candles unattended.

Earlier this week, three members of a Brampton family died of suspected carbon monoxide poisoning after their furnace broke down and they used a propane heater indoors.

@ChrisKitching is on Twitter. For up-to-the-minute breaking news, follow @CP24 on Twitter.