Paraguay was also affected when the Itaipu dam straddling the two nations' border stopped producing 17,000 megawatts of power, resulting in outages in Rio de Janeiro, Sao Paulo and at least several other big Brazilian cities, Brazilian Mines and Energy Minister Edison Lobao said.
The cause of the failure had not been determined, but Lobao said strong storms uprooted trees near the Itaipu dam just before it went offline and could be to blame. Rio was the hardest hit city, he said.
Lobao said the hydro plant at the dam itself was working, but there were problems with the power lines that carry electricity across Brazil. Brazil uses almost all of the energy produced by the dam, and Paraguay consumes the rest.
The blackouts came three days after CBS's "60 Minutes" news program reported that several past Brazilian power outages were caused by hackers. Brazilian officials had played down the report before the latest outages, and Lobao did not mention it.
Brazil's official Agencia Brasil news agency said Tuesday's outage started about 10:20 p.m. (1220 GMT), snarling streets in Rio after traffic lights stopped working. Subway service was knocked out in both Rio and Sao Paulo, and G1 said Sao Paulo subway users were forced to abandon train cars.
In the city of Taguatinga near the national capital of Brasilia, a second division Brazilian league soccer game was halted after lights illuminating the field went dark. No power outages happened in Brasilia.
Utility companies that provide electricity for Rio and Sao Paulo did not immediately offer explanations for why the power went off or when it would be restored, Agencia Brasil said.
Sao Paulo is South America's largest city, with 12 million residents. Rio has 6 million citizens. But the metropolitan area of both cities are much larger. Also affected was Belo Horizonte in central Brazil and the northeastern city of Recife.
The Itaipu dam is the world's second biggest hydroelectric producer, supplying 20 percent of Brazil's electricity. China's Three Gorges dam is the largest.
Associated Press writers Marco Sibaja in Brasilia and Alan Clendenning in Mexico City contributed to this report.