Authorities said a 3-year-old boy was in the kitchen playing with the stove's burners. They said his mother didn't know until he started to scream, but by the time she got into the room, it was too late.
During a press conference, fire officials said the child has a history playing with burners and that fires caused by children are not "unusual but are sad."
Investigators said a natural gas line fueled a fire.
It's the worst fire tragedy in NYC in at least a quarter of a century.
The victims killed were eight adults and four children - ranging in age from 1 to 63. Four people remain in critical condition.
"It is an unspeakable tragedy, and families have been torn apart," de Blasio said.
The 5-alarm fire broke out just before 7 p.m. on Prospect Avenue near East 187 St. on the first floor of the five-story building.
The flames quickly spread up to the fifth floor. The building is described as "non-fireproof" and is highly combustible.
PHOTOS from the scene:
More than 170 firefighters responded to the scene.
The fire was brought under control just after 9 p.m. The scene is described as having a very heavy smoke condition. The victims perished on every floor of the building.
"In a department that's certainly no stranger to tragedy we're shocked by this loss," FDNY Commissioner Daniel Nigro said.
The Office of Emergency Management and the MTA sent buses to the location to accommodate residents that have been evacuated from the building.
"This is the worst fire tragedy we have seen in this city in at least a quarter-century," Mayor de Blasio said during a press conference at the scene. "Based on the information we have now, this will rank as one of the worst losses of life to a fire in many, many years."
Fire Commissioner Daniel Nigro called the fire, "historic in its magnitude," because of the number of lives lost. Excluding the Sept. 11 attacks, it was the worst fire in the city since 87 people were killed at a social club fire in the Bronx in 1990.
"Our hearts go out to every person who lost a loved one here and everyone who is fighting for their lives," Nigro said.
Some tenants of the building, a mix of native New Yorkers and Latino and African immigrants, climbed down fire escapes. But the flames moved so fast that many never made it out of their apartments.
Thierno Diallo, 59, a security guard originally from Conakry, Guinea, who lives in a ground floor apartment said he was home asleep when he heard banging on the door. It took him a moment to realize what was happening.
"Only when I heard people screaming, 'There's a fire in the building!'" he said. "I heard somebody, 'Oh! Fire! Fire! Fire!'"
He ran out in his bathrobe, jacket, and sandals.
Kenneth Kodua, 37, said he left his apartment to get food, leaving his roommate behind and came back to find people fleeing in a panic.
Hours later, he was still trying to find out whether his roommate escaped.
"I tried calling her. I tried calling. No answer," he said, still clutching his bag of uneaten food. His phone was dead.
Many questions remained in the immediate aftermath of the blaze, including how the fire spread so quickly in a brick building built after catastrophic fires at the turn of the 20th century ushered in an era of tougher enforcement of fire codes.
The building had more than 20 units. It was not new enough that it was required to have modern-day fireproofing, like sprinkler systems and interior steel construction.
Eyewitness News Reporter Josh Einiger was live on the scene:
Neighborhood resident Robert Gonzalez, who has a friend who lives in the building, said she got out on the fire escape as another resident fled with five children.
"When I got here, she was crying," Gonzalez said.
Other witnesses described seeing burned bodies being carried away on stretchers and young girls who had escaped the building standing barefoot outside with no coats.
Windows on some upper floors were smashed and blackened. Displaced residents wrapped in Red Cross blankets were staying warm on city buses, brought in to provide heat.
The death toll surpassed the 10 who died, including nine children, in a four-story home in another part of the Bronx in 2007. That blaze had been sparked by a space heater.
Diallo said the apartment building has tenants who hail from all over the world.