By Daniel Politi and Clifford Krauss

New York Times News Service

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

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

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. By 6 p.m. Argentina time, power had been restored to most of Argentina and Uruguay.