Out of the frying pan, into the fire.

Thousands of Big Apple residents lost power just as temperatures reached their zenith Sunday afternoon, according to energy providers.

Some 10,000 Con Edison customers were sweating it out without power as of 6 p.m. Sunday, an outage map provided by the power company showed.

The number was a fraction of that just an hour before, but swaths of Brooklyn began losing electricity just after 5 p.m. — when the heat index reached a blistering 102, according to the National Weather Service, and The Post measured 113 degrees in Times Square.

“Con Ed is responding to outages affecting roughly 4,500 customers citywide. Largest outages are in Flushing and Richmond Hill in Queens; Park Slope, Flatbush and Brighton Beach in Brooklyn; and Lincoln Square in Manhattan,” Mayor Bill de Blasio tweeted at 5:07 p.m., as lights were going out across Kings County.

“City agencies are working with them to restore power ASAP. Follow @NotifyNYC for updates on restoration.”

As of 5:30 p.m., there were 3,697 customers without power in Queens and 4,685 lacking electricity in Brooklyn. Manhattan fared better with just 257 outages, while the Bronx had 11 and Staten Island had 31.

Thirty minutes later, Queens was at 4,085, Brooklyn had 4,787 without power, and the Bronx spiked to 1,359. Meanwhile, there were 188 outages in Manhattan and 94 on Staten Island at 6 p.m.

The wavering lights came as Big Apple residents sucked up a record amount of juice Sunday evening, when the city set a new high mark for weekend power consumption.

At one point in the 4-5 p.m. hour, Con Ed was pumping out 12,048 megawatts of electricity, edging out a record spike of 11,855 megawatts set between 3 and 4 p.m. on Aug. 13, 2016, a spokesman said. An average weekend load is 10,000, while weekdays can see 13,000 megawatts as Manhattan’s myriad offices flicker to life.

The utility blamed the heat wave — which sent the heat index soaring to 110 degrees — for overheating equipment that led to outages, and explained that demand can sometimes spike as people return home to the city Sunday night.

Crews will be working overnight to restore power, the Con Ed spokesman said.

The power failures paled in comparison with last weekend’s blackout, when some 73,000 customers lost power in Manhattan for several hours.