SAN JUAN, Puerto Rico — An explosion and fire at an electric substation threw much of northern Puerto Rico into darkness late Sunday in a setback for the U.S. territory’s efforts to fully restore power more than five months after Hurricane Maria started the longest blackout in U.S. history. The island’s Electric Power Authority said several municipalities were without power, including parts of the capital, San Juan, but they were optimistic it could be restored within a day as they worked to repair a substation that controls voltage.

The blast illustrated the challenges of restoring a power grid that was already crumbling before it was devastated by the Category 4 hurricane.

Officials said the fire was quickly extinguished and that the explosion knocked two other substations offline.

Carlos Monroig, an administrator for the press office of the Electric Power Authority, told CBS News that the cause of the explosion was due to mechanical failure.

“We are trying to restore that as quickly as possible,” the company said.

Monroig told CBS News that power should be restored by Monday night at the latest.

CBS News’ David Begnaud cited officials as saying 400 megawatts of generation were lost after an explosion/fire at the Monacillos power plant:

Heavy black smoke billowed from the substation as neighbors in the area described on social media seeing the sky turn orange following a loud explosion. San Juan Mayor Carmen Cruz tweeted that no injuries had been reported.

Video posted to social media apparently showed flames at the power plant in San Juan earlier in the night:

Begnaud also tweeted out more information Sunday night to describe the areas impacted by the blackout:

The blackout occurred as more than 400,000 power customers remain in the dark more than five months after Hurricane Maria. The Category 4 storm destroyed two-thirds of the island’s power distribution system and caused up to an estimated $94 billion in damage.

Puerto Rico’s governor announced last month that he plans to privatize the state-owned power company, which relies on infrastructure nearly three times older than the industry average. It would be the largest restructuring of a public entity in U.S. history.

One week after his announcement, a federal control board overseeing the island’s finances asked that a judge authorize a loan of up to $1.3 billion so the power company can keep operating. The board said the company could see an estimated $1.2 billion loss in revenue in the first six months after Hurricane Maria.

CBS News’ Jorge Mitssunaga contributed to this report.