Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

An islandwide blackout hit Puerto Rico on Wednesday, knocking out power throughout the island seven months after Hurricane Maria destroyed its electrical grid.

Geraldo Quiñones López, a spokesman for the Puerto Rico Electric Power Authority, told NBC News early Wednesday afternoon that there was "zero percent" power generation on the island.

"The breakdown affected the entire electrical system and generating plants," he said.

Crews were investigating the blackout and it could take 24 to 36 hours to fully restore power, he added.

Justo González, an executive deputy director of the power authority, said during a news conference Wednesday afternoon that the blackout was caused by “a circumstance with a contractor."

He said the contractor was working to remove a collapsed tower when a bulldozer approached a power line, causing it to fail.

The Morning Rundown Get a head start on the morning's top stories. This site is protected by recaptcha

There was “a sudden, strong change of frequency and voltage,” he said.

Just last week, 840,000 customers were left without power after a single tree fell on another power line in the center of the island, causing a massive blackout that shut service to the island's international airport, the metro area light rail line, Puerto Rico's biggest mall and the biggest public hospital in San Juan, the capital. A backup line that was supposed to prevent such an outage also failed.

The company involved in Wednesday's and last week's failures, Dgrimm, was subcontracted by Cobra, a subsidiary of Oklahoma-based Mammoth Energy Services that was hired to help with power restoration efforts, Quiñones said.

Juan Castro fills a generator with gasoline to power the cabinet-building workshop where he works in San Juan, Puerto Rico, on Wednesday. Carlos Giusti / AP

Dgrimm had been asked to change its security protocols after the first power failure, a power company official told The Associated Press. Quiñones said the company had been fired and would no longer be helping with restoration efforts.

The power authority said in a post on Twitter Wednesday afternoon that energy was restored to customers in the municipalities of Maunabo, Naguabo, Mayagüez, Arecibo and Toa Baja. The islands of Vieques and Culebra never lost electrical power.

The company said in an earlier post that it was prioritizing re-establishing power to hospitals, the Luis Muñoz Marín International Airport, pumping systems for the Puerto Rico Aqueducts and Sewers Authority, and central banks.

The airport said on Twitter that it was running on a generator and so far no flights had been canceled or delayed.

It's the first time since Category 4 storm Maria hit the island on Sept. 20 that Puerto Rico has experienced a full islandwide blackout.

About 40,000 power customers are still without even normal electricity service as a result of the hurricane.

San Juan Mayor Carmen Yulín Cruz tweeted Wednesday: "The entire electrical system in Puerto Rico collapses AGAIN! Back to September 20th."

The entire electrical system in Puerto Rico collapses AGAIN! Back to September 20th. @DavidBegnaud @leylasantiago @maddow @stephencolbertr — Carmen Yulín Cruz (@CarmenYulinCruz) April 18, 2018

The outage did not stop a baseball game between the Minnesota Twins and Cleveland Indians Wednesday night, as power was restored to Hiram Bithron stadium in San Juan. The Twins beat the Indians 2-1.

"Playball! Nothing will stop us," Cruz tweeted.