Con Edison was cutting off power “temporarily” across parts of Brooklyn on Sunday night due to the ongoing heatwave — with some 30,000 customers said to be affected, according to city officials.

The move, which was announced in a tweet by Mayor Bill de Blasio, was ultimately done so Con Ed could “make repairs and prevent a bigger outage” following the string of blackouts that were reported earlier in the day.

“I just spoke to Con Ed’s president about tonight’s outages,” the mayor said. “Their system in parts of Brooklyn is under severe strain and some equipment has failed…Con Ed is taking 30K customers in Brooklyn, including Carnarsie, Mill Basin and Flatbush, temporarily off power so it can make repairs and prevent a bigger outage …. @NYPDnews, @FDNY and @NYCEmergencyMgt are all adding personnel on the ground across that part of Brooklyn to respond to emergencies and keep people safe.”

Con Ed said it was also planning to “reduce voltage” in parts of Prospect Lefferts Gardens, Prospect Heights, Flatlands, Bergen Beach and Georgetown.

A command post will be set up in the affected area to aid people at nursing homes and adult care facilities, the mayor said.

“City agencies are working with Con Ed to resolve this as quickly as possible,” de Blasio tweeted. “In the event of an emergency, contact 911.”

Residents across Queens and the Bronx, in addition to Brooklyn, were reporting outages on Sunday amidst the ongoing heatwave. Con Ed was asking customers to limit their use of “non-essential appliances” in an attempt to avoid losing power.

“It’s still above 90 and I know there are a lot of hot and frustrated people out there, not just in Brooklyn but in parts of Queens and the Bronx,” the mayor said. “Con Ed is working to restore power and City agencies are working to help speed up restoration in every way we can.”