A blackout that spread across at least nine states of southern, central and north-western Brazil was caused by a failure at a hydroelectric dam, the country"s energy minister said. The power outage Tuesday night and into Wednesday morning affected 40 million people and left about 800 cities - including Sao Paulo, Rio de Janeiro, Belo Horizonte and Brasilia - in the dark, media reports were quoted as saying by the German Press Agency "DPA". Energy Minister Edison Lobao speculated that a storm had disconnected power transmission lines at the Itaipu dam, which lies on the Brazilian-Paraguayan border and provides more than 20 per cent of Brazil"s energy. Technicians were working to get the power supply back on line quickly, both Lobao and Itaipu"s operating company said. The power outage began shortly after 10 pm (midnight GMT). The first lights came back on in Rio de Janeiro a few hours later, but the blackout continued in other locations. In the meantime, thousands of people were trapped in elevators, subways and suburban trains. Road traffic was also chaotic as the power outage darkened traffic lights, and the police were put on high alert and stepped up their patrols as an outbreak of crime was feared. Only large office buildings and hotels with generators were lit in Sao Paulo, Brazil"s financial capital, correspondents for the German Press Agency DPA said. The country"s largest airports were also using generators and providing limited emergency service, they said. Many flights had to be cancelled. Brazil"s phone network largely collapsed, but its mobile-phone network was still operating. President Luiz Inacio Lula da Silva convened an emergency government meeting on the crisis.