BUENOS AIRES, Argentina (AP) — A massive blackout left tens of millions of people without electricity in Argentina, Uruguay and Paraguay on Sunday after an unexplained failure in the neighboring countries' interconnected power grid. Authorities were working frantically to restore power, but by mid-afternoon nearly half of Argentina's 44 million people were still in the dark.

Voters cast ballots by the light of cell phones in gubernatorial elections in Argentina. Public transportation halted, shops closed and patients dependent on home medical equipment were urged to go to hospitals with generators.

"I was just on my way to eat with a friend, but we had to cancel everything. There's no subway, nothing is working," said Lucas Acosta, a 24-year-old Buenos Aires resident. "What's worse, today is Father's Day. I've just talked to a neighbor and he told me his sons won't be able to meet him."

By mid-afternoon, power had been restored to most of Uruguay's 3 million people. But in Argentina, only 56% of the nation's grid was back up and running as of 3:30 p.m. local time, Energy Secretary Gustavo Lopetegui told a news conference.

"This is an extraordinary event that should have never happened," Energy Minister Gustavo Lopetegui said. "It's very serious."

He said the cause of the massive outage was still under investigation and that workers were working to restore electricity nationwide by the end of the day.

Argentina's power grid is generally known for being in a state of disrepair, with substations and cables that were insufficiently upgraded as power rates remained largely frozen for years.

An Argentine independent energy expert said that systemic operational and design errors played a role in the power grid's collapse.

"A localized failure like the one that occurred should be isolated by the same system," said Raúl Bertero, president of the Center for the Study of Energy Regulatory Activity in Argentina. "The problem is known and technology and studies (exist) to avoid it."

The country's energy secretary said the blackout occurred at 7:07 a.m. local time when a key interconnection system collapsed.

Argentine energy company Edesur said on Twitter that the failure originated at an electricity transmission point between the power stations in Yacyretá and Salto Grande in the country's northeast.

Uruguay's energy company UTE said the failure in the Argentine system cut power to all of Uruguay at one point and blamed the collapse on a "flaw in the Argentine network."

In Paraguay, power in rural communities in the south, near the border with Argentina and Uruguay, was also cut. The country's National Energy Administration said service was restored by afternoon by redirecting energy from the Itaipu hydroelectric plant the country shares with neighboring Brazil.

In Argentina, only the southernmost province of Tierra del Fuego was unaffected by the outage because it is not connected to the main power grid.

Brazilian and Chilean officials said their countries had not been affected.

Many residents of Argentina and Uruguay said the size of the outage was unprecedented in recent history.

"I've never seen something like this," said Silvio Ubermann, a taxi driver in the Argentine capital. "Never such a large blackout in the whole country."

Several Argentine provinces had elections for governor on Sunday, which proceeded with voters using their phone screens and built-in flashlights to illuminate their ballots.

"This is the biggest blackout in history, I don't remember anything like this in Uruguay," said Valentina Giménez, a resident of the capital, Montevideo. She said her biggest concern was that electricity be restored in time to watch the national team play in the Copa America football tournament Sunday evening.

Since taking office, Argentine President Mauricio Macri has said that gradual austerity measures were needed to revive the country's struggling economy. He has cut red tape and tried to reduce the government's budget deficit by ordering job cuts and reducing utility subsidies, which he maintained was necessary to recuperate lost revenue due to years-long mismanagement of the electricity sector.

According to the Argentine Institute for Social Development, an average family in Argentina still pays 20 times less for electricity than similar households in neighboring countries.

The subsidies were a key part of the electricity policy of President Néstor Kirchner's 2003-2007 administration and the presidency of Kirchner's wife and successor, Cristina Fernández in 2007-2015. Fernandez is now running for vice president in October elections.

______

Associated Press writers Patricia Luna in Santiago, Chile, and Natalie Schachar in Mexico City contributed to this report.