BUENOS AIRES — A blackout stripped all of mainland Argentina and Uruguay of power early Sunday, affecting tens of millions of people in an electrical failure that officials called unprecedented in its scope.
The cause remained under investigation by late Sunday, when power had been largely restored to both countries. Much of Argentina was hit by heavy rainfall over the weekend, and Uruguay’s state-owned utility, UTE, said some systems had been damaged by the recent rain and still needed to be repaired.
“This is the first time something like this has happened across the entire country,” said Alejandra Martínez, a spokeswoman for Edesur, an electricity company in Argentina that serves parts of Buenos Aires and its suburbs. She called it “a complete blackout in Argentina.”
The blackout may have affected a population greater than California’s, across a region four times the size of Texas: Argentina has more than 44 million people, and Uruguay about 3.5 million.
“There was a failure in the system, the type of failure that takes place regularly in Argentina and in other countries,” Argentina’s energy secretary, Gustavo Lopetegui, said at a news conference. But then, he said, “there was a chain of events that happened later that caused a total disconnection.”
Across the region, residents posted images on social media of their darkened towns and cities.
In Buenos Aires, a city of almost 15 million people, cars slowed to a crawl as traffic lights went dark, and trains and subways stopped on their tracks. Demian Luis Martínez, 36, a taxi driver, said he had spent the early part of his shift failing to find an open gas station. Everything was closed.
“It looked like a zombie city,” he said. “There were car crashes everywhere.”
Mr. Martínez said he had not seen any police officers directing traffic. “The government is very lucky this happened in the morning and not in the middle of the night,” he said.
The Argentine water company AySA asked customers to ration water because its distribution system had been shut down.
Alejandra Perez, 42, the caretaker of a 92-year-old woman, said she “started to frantically look for candles” when her building lost power. “I had to figure out how to get everything done without light.”
Familiar with Buenos Aires’s more common minor blackouts, she recalled that the water pumps in her building rely on electricity — meaning that when the power goes out, the water sometimes runs short.
“I quickly got hold of any big pots and buckets I could find and filled them with water,” she said. “We know exactly what to do.”
Flights were operating normally, said Carlos Armentano, a spokesman for Aeropuertos Argentina 2000, the company that runs most of the country’s airports. But Argentine ports came to a standstill for a few hours, said Guillermo Wade, the manager for the Port and Maritime Activities Chamber.
The Secretariat of Energy said that an electrical grid that serves both nations “collapsed” at 7:07 a.m., cutting electricity in all of Argentina and Uruguay as well.
Edesur, the electrical distribution company, announced on Twitterabout 7:50 a.m. that a “massive failure in the electrical interconnection system left all of Argentina and Uruguay without power.”
Uruguay’s UTE also said on Twitter that a malfunctionin the Argentine network before dawn had left the “entire national territory” without service.
Although officials said every possible cause would be considered, “we do not believe that a cyberattack is within the possibilities,” said Mr. Lopetegui, the energy secretary.
“This was an extraordinary event that should not have occurred,” he said, calling Argentina’s electrical grid “robust with excess capacity in both generation and transportation.”
Although it is true that Argentina has solid generation and distribution capacity, “transportation clearly needs an upgrade because there are lots of parts of the system that are saturated,” said Gerardo Rabinovich, an energy consultant who is vice president of the Argentine Energy Institute.
“Generally, though, these things happen not because of a lack of robustness in the system but rather a lack of coordination,” Mr. Rabinovich said. “Failures in lines can happen, but what cannot happen is for this failure to then propagate to the whole system.”
Constitución Station in Buenos Aires was dark on Sunday, with no rail service.
The power failure also affected southern Brazil, said Carlos García Pereira, general manager of Transener, the country’s high-voltage power transportation company.
By 10:30 p.m., power had been restored throughout Argentina and in most of Uruguay.
Delays were reported in the Patagonia region of Argentina, thanks to failures in the area’s power plants. Only the southern archipelago of Tierra del Fuego appeared to have been unaffectedbecause it is not connected to the national grid.
Blackouts are relatively common in Argentina, which is mired in a recession and is the second-largest consumer of electricity in South America, after Brazil. Failures were more prevalent when the economy was booming because demand was higher then.
But the scale of Sunday’s power failure appeared to take residents and officials off guard. Blackouts usually take place in periods of peak demand, particularly during the height of the hot summer months — December, January and February — rather than the mild winter month of June.
Years of virtually frozen electricity rates under the previous administration had led to a dearth of investment in the sector. Yet prices for electricity have soared since President Mauricio Macri took office in December 2015, and investment in electricity generation has also increased.
The Argentine government has commissioned more hydroelectric, thermal and renewable energy projects, as well as a modernization of the transmission system, which is highly regulated. Mr. Macri has slashed high energy subsidies as part of a broader effort to impose austerity measures and promote investment in the sector.
Argentina produces most of its electricity domestically, although it imports some power through transmission interconnections with Brazil, Chile, Paraguay and Uruguay.
In 2009, a huge power failure in Brazilinvolving the world’s largest operating hydroelectricplant caused widespread blackouts that affected tens of millions of people and exposed the vulnerability of the country’s electricity infrastructure.
That failure occurred at the Itaipú plant, which straddles the border between Brazil and Paraguay along the Paraná River and is a critical source of power for both nations.
This March, a severe blackout affected virtually all of Venezuela for days, compounding the economic and political crisis that has crippled the country and keeping about 30 million people in the dark.
The government blamed an attack by the American government, which denied responsibility. Union leaders said the failure was most likely the result of a brush fire that destabilized the country’s electrical grid, which had long been prone to rolling blackouts because of mismanagement and a lack of maintenance.