The occasion prompted officials to remind New Yorkers that open doors hasten the spread of flames.
“Close the door, close the door, close the door,” the fire commissioner, Daniel A. Nigro, said at a news conference on Friday.
It was a familiar refrain. In 1998, four people died on the Upper West Sideafter smoke from a fire in the apartment where the family of the actor Macaulay Culkin lived spread to the rest of the building because apartment and stairwell doors were propped open.
In the Bronx fire, it is not clear what combustible material the stovetop flames lit. The mother told investigators her son had a history of turning on the burners.
Her apartment door faced the stairwell, so leaving it open created a direct path from her kitchen up the rest of the building, which had about 25 apartments. Constructed of plaster and brick in 1916, it was not fireproof.
When Edwin Ramos got off a bus nearby on Thursday night, he saw people crammed onto the fire escape, their feet planted but their bodies leaning as far as possible over the railing to get space from the flames. They gripped the railings, trying desperately to hold on.
“I was just hoping that nobody jumped,” Mr. Ramos said.
The smoke was so thick that an elderly woman next to him began spitting and coughing uncontrollably, he said, so he took off his scarf and wrapped it around her instead.
On the fire escape, chaos reigned, said Maria Pacheco, a neighbor from a nearby building.
“Movies are nothing compared to what I saw,” she said.
Angelo Villanova, 23, who grew up in Belmont and was back visiting a friend, was going to the store for a bag of ice when he passed the burning building. A girl ran out.
“She was coughing and I started — ” he said, making chest-pumping motions with his hands. “I went in the building but I was suffocating. I couldn’t breathe. So I went out and I said, ‘Someone give me a boost!’”
With a hoist, he leapt onto the fire escape in front of the building, unhooked the ladder and started helping people down — children first. But he said another fire escape on the side of the building was cloaked in flames and impossible to scale. Debris fell from the windows.
A delivery man who lives in a neighboring building, Kareem Turner, 26, saw Mr. Villanova near the back fire escape. He went outside.
“It is all good?” he asked.
“Nah! It’s a fire!”
Mr. Turner said he jumped over a gate dividing the buildings and began hoisting people over. The fire, already raging on the side of the building, traveled to the back.
“The fire was following us,” he said. “If I had not seen them, and helped them, they would have perished for a fact.”
Firefighters on Engine 88 arrived three minutes after the first 911 call, only to find the hydrant frozen. Some firefighters called for ambulances for the three victims in the entrance hall while others stepped around them.
“Now we have multiple victims and we don’t have water,” said Lt. Mickey Conboy, a 32-year veteran who serves in Rescue Company 3.
The engine drove up the block looking for another hydrant while hose lines extended onto the street from the back. Firefighters quickly found one on 187th Street.
“It didn’t slow activity,” Mr. Nigro said of the frozen hydrant. “By the time the door was opened they had already connected to another hydrant.”
Lieutenant Conboy said firefighters reached portable ladders up to ease the overcrowding on the fire escape.
“It was a very unique fire experience,” he said. “All the floors above the hallway and the stairwell were incinerated.”
Angelo Duran was working at the Bronx Zoo Deli on the corner when the superintendent of a nearby building ran in shouting for help.
People were still on the fire escape, some of them too scared to descend. After Mr. Duran yelled for them to come down and fire trucks arrived, he watched firefighters emerge from the building with a thin boy who was unconscious. They set him down near Mr. Duran’s feet.
“They went to get oxygen and I just stayed there rubbing his chest,” he said. “I rubbed his chest.”
Firefighters carried out two more unconscious victims: a man with smoke rising off his clothes, and a woman who appeared to have been burned.
In all, five people were found dead inside the building, all on the third and fourth floors.
Seven others were pronounced dead at nearby hospitals. The authorities had not yet officially released the names of the victims.
Temperatures were in the teens on Thursday night, and stiff winds made it feel below zero. Water leaking from hoses froze in streaks on the concrete as displaced residents walked around draped in American Red Cross blankets.
The building had open violations for a broken smoke detector and carbon monoxide detector in a first-floor apartment, according to city records. But Mr. de Blasio said those issues did not appear to be related to the fire.
The 12 fatalities made the fire the deadliest since an inferno at the Happy Land Social Club — less than a mile from Thursday’s blaze — killed 87 people in 1990. Thursday’s toll surpassed that of a 2007 blaze in the Bronx caused by an overheated cord that killed 10 people, nine of them children.
Hours after the Bronx fire, another fire tore through a building in Bedford-Stuyvesant, Brooklyn. Two more men died, the 23rd and 24th fire fatalities this December.