SAN JUAN, Puerto Rico — A sudden power failure left more than 337,000 customers in the dark across Puerto Rico late Wednesday, enraging many who were recovering from a massive outage that hit the U.S. territory just days ago.

Luma Energy, a private company that took over the island's power transmission and distribution system on June 1, said three units were knocked offline for reasons not immediately known. At first, the company said some 190,000 customers had been affected, but it later tweeted that power had been restored to more than 252,700 customers, leaving more 84,000 still without electricity.

Various spokeswomen did not return calls for comment.

The latest outage unleashed a flood of complaints on social media as anger spread among thousands of people who were forced to throw out food and refrigerated medication including insulin in recent days. Some also complained about damaged appliances as lights flickered on and off since Thursday's outage that left 900,000 people in the dark.

Wednesday's outage came just hours after Luma warned that services would be interrupted nightly for the next three days given pre-scheduled maintenance at one plant and interruptions in the generation of power run by Puerto Rico's Electric Power Authority. The most recent outage is not related to the upcoming interruptions in service, Luma said.

It's the latest challenge to hit a company that has come under scrutiny amid high expectations that it would briskly solve problems despite having to rely on aging infrastructure and a fragile power grid that has not been strengthened since Hurricane Maria razed it in 2017 as a Category 4 storm, leaving some customers without power for up to a year.

Victoria Pérez, who lives in the capital of San Juan, said power in her neighborhood of Río Piedras usually goes out two to three times a week, but that outages have recently worsened. She and her family already had spent two days without electricity when Thursday's massive outage hit, adding that they have had to adjust their budget and buy gasoline to keep their generator going.

"These days it's been running like it's Maria all over again," she said. "The entire neighborhood is noisy."

The outages have been so constant lately that several mayors have declared states of emergency and handed out generators and ice to those most in need, as well as hired private crews to restore power after saying that Luma informed them they lacked enough brigades.

Earlier Wednesday, Luma said it was still probing what caused a large fire at a main substation that led to Thursday's outage, adding that the investigation won't be finalized for another four to six weeks.

Luma is a consortium made up of Calgary, Alberta-based Atco and Quanta Services Inc. of Houston. It serves roughly 1.5 million customers as part of a 15-year contract with Puerto Rico's government, which remains the owner and operator of the island's power generators.

Copyright 2021 NPR. To see more, visit https://www.npr.org.