A 3-year-old started the city’s deadliest inferno in more than a quarter-century — fiddling with the knobs on his family’s kitchen stove to spark a blaze that raged for two hours and killed 12.

The little boy — who FDNY Commissioner Daniel Nigro said has a “history of playing with the burners and turning them on” — got into the deadly mischief Thursday night when his mother left him and his 2-year-old sibling alone while she took a shower, law-enforcement sources revealed Friday.

The mom “puts them in front of the TV to watch cartoons and goes to take a shower. She takes her time, 20 minutes maybe,’’ a source said.

“She comes out, sees all smoke coming out of the kitchen,’’ the source said. “She says, ‘Holy sh-t!’ grabs the two kids and runs out the door.’’

The mom left the apartment door open in her rush to escape, Nigro said. This allowed the 6:51 p.m. blaze at 2363 Prospect Ave. to quickly spread up the stairwell to the top of the five-story, 26-unit building, turning it into a “chimney” of smoke and flames and trapping residents inside, he said.

“It took the fire so quickly up the stairs that people had very little time to react, they couldn’t get back down the stairs” Nigro said. “Those that tried, a few of them perished.”

When firefighters arrived in the hallway of the first floor of the five-story, 26-unit building, bodies were already piling up.

It took firefighters 138 minutes, until 9:09 p.m., to finally extinguish the blames.

Among the other developments Friday:

The identities of most of the 12 victims were released, with the dead ranging in age from 8 months old to 58 years. The victims — five of whom perished inside the building, and seven who later died in the hospital — included a soldier and four members of one family.

Four survivors remained in critical condition Friday evening, suffering from burns and smoke inhalation.

The FDNY released eerie video of the burned-out building — providing a tour though the blackened stairwell and hallways that acted as a passage for the inferno and where many of the victims were found choking on smoke.

Police sources revealed that the closest fire hydrant to the burning building was frozen in the frigid winter temperatures — forcing the 200 firefighters who responded to the scene up the road to get water to douse the blaze.

City officials revealed that the building had six open violations — including one for a defective smoke alarm and faulty carbon monoxide detector issued in August. But while the faulty units had been on the first floor — where the fire began — they were not in the apartment where Thursday’s blaze started, according to a Department of Housing Preservation spokeswoman.

Many of the stunned survivors spent the day shivering in an empty MTA bus outside their decimated home, where the Red Cross offered blankets and comfort.

No charges are being considered against the mom of the young fire-starter, police said — but other residents of the Prospect Avenue property were fuming at her for leaving her kid unsupervised.

“I would kick [the mother’s] a— all over the place,” said Shevan Stewart, who lost four family members in the blaze.

“You got to school your children. You and your children cost 12 people their lives,” she said.

Nigro noted that firefighters responded to the inferno about 3 minutes after the 911 call was made.

“Most of the deaths occurred very early in the operation. Some of them even before we arrived,” Nigro said.

Most, if not all, of the victims died of smoke inhalation rather than burns, sources said.

Investigators are still working to determine whether all the smoke alarms in the building were functioning, Nigro said. But Mayor de Blasio told WNYC radio that it appears “there was nothing problematic about the building that contributed to this tragedy.”

Nigro noted that the incident should serve as a reminder to always keep young children within arm’s reach — and to trap flames behind closed doors.

“You’ve seen the ads — close the door, close the door, close the door,’’ he said. “ Unfortunately, if you have a fire in your apartment, you just close the door when you exit — because the results if you don’t are what happened here last night.”

The mayor added, “As parents, the reminder is be very, very careful with your children anywhere near a source of fire — whether it’s matches or a candle or a stove or anything — and keep them away and, you know, create as many barriers as possible. And keep an eye on them.”

Twenty-four New Yorkers have died in blazes so far this December — making it the deadliest month for fires in a decade and bringing this year’s total fire deaths to 71, according to the FDNY.

Last year saw only 48 fire deaths — the lowest in the city’s recorded history.

Additional reporting by Joe Marino, Sarah Trefethen and Natalie Musumeci