SAN JUAN, Puerto Rico -- A major blackout hit Puerto Rico's most populated region Wednesday just as the government announced it had met its goal of 50 percent power generation nearly two months after Hurricane Maria struck as a Category 4 storm.

The Electric Power Authority said it dispatched crews to investigate why a key 230-kilovolt line that connects the island's northern and southern regions had failed for the second time in a week. The failure caused the U.S. territory's power generation to drop to 22 percent, though it had improved slightly to 29 percent by early evening.

The blackout affected the capital of San Juan and nearby cities and towns along the island's north coast, provoking a groan from people who were celebrating the return of electricity in recent weeks by restocking refrigerators and charging phones and computers.

Get Breaking News Delivered to Your Inbox

A previous blackout involving the same line occurred Nov. 8, causing power generation to drop to 18 percent.

On social media, some Puerto Ricans wondered whether the blackout was caused by the government's rush to meet its goals to restore power. Puerto Rico Gov. Ricardo Rossello has pledged 80 percent power generation by the end of November and 95 percent power generation by Dec. 15, while the U.S. Army Corps of Engineers has said it expects 75 percent power generation by the end of January.

Susan Tierney, a senior adviser for Denver-based consulting company Analysis Group who testified last month before a U.S. Senate committee on efforts to restore power, said blackouts are likely to occur if a power company is having problems matching supply and demand.

"Something has to give," she said in a phone interview, adding that she is surprised at how slowly power is being restored across Puerto Rico. "It's extraordinary to have an outage that has extended this deeply and for so long after an event."

More than 130,000 people have fled the island since the hurricane, with many seeking jobs and shelter on the U.S. mainland.

Prior to Wednesday's blackout, Puerto Rico's power company said 21 municipalities still had no power at all, while portions of Puerto Rico's 57 other municipalities had seen electricity restored.

The island's power outage is the worst in U.S. history.