A massive blackout left tens of millions of people without electricity in Argentina, Uruguay and Paraguay on Sunday. The Argentine president called it an "unprecedented" failure in the countries' interconnected power grid.

Authorities were working frantically to restore power, and by the evening, electricity had returned to 98 percent of Argentina, according to state news agency Telam. Power also had been restored to most of Uruguay's 3 million people as well as to people in neighboring Paraguay.

Earlier Sunday, Argentine voters were forced to cast ballots by the light of cellphones in gubernatorial elections. Public transportation was halted, shops closed and patients dependent on home medical equipment were urged to go to hospitals with generators.

Get Breaking News Delivered to Your Inbox

"This is an unprecedented case that will be investigated thoroughly," Argentine President Mauricio Macri said on Twitter.

Hallways of Buenos Aires' subway are lit only by emergency lights during a blackout, in Buenos Aires, Argentina, Sunday, June 16, 2019. AP

"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."

"This is an extraordinary event that should have never happened," Energy Secretary Gustavo Lopetegui told a news conference. "It's very serious."

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. Lopetegui said the blackout occurred around 7 a.m. local time when a key Argentine interconnection system collapsed. By mid-afternoon nearly half of Argentina's 44 million people were still in the dark.

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 Argentine energy company Edesur said on Twitter that the failure originated at an electricity transmission point between the power stations at the country's Yacyretá dam and Salto Grande in the country's northeast.

Uruguayan energy company UTE said that a failure in the Argentine system cut power to all of Uruguay at one point and much of Argentina. The company said that some Uruguayan coastal cities had service by early afternoon and blamed the collapse on a "flaw in the Argentine network."

Argentina's secretary of energy said the power failed at 7:07 a.m. Only the southernmost province of Tierra del Fuego was unaffected.

"The cause is still under investigation," the energy secretary's office said.

A man stands inside a store without power during a blackout, in Buenos Aires, Argentina, Sunday, June 16, 2019. AP

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.

"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, Argentina's 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.