Rio de Janeiro: A blackout that plunged northeast Brazil into complete darkness for several hours last week was caused by human error, an official said.

Director of the National Energy Agency (ANEEL) Nelson Hubner said the power outage, affecting all nine northeastern states and parts of the north central and midwest regions, was caused by a flaw in a piece of equipment located between two energy substations in Colinas and Imperatriz, reported Xinhua.

Hubner said the equipment's safety mechanism was not properly programmed, otherwise the affected region would have been much smaller. The government will take steps needed to ensure that such an error does not occur again, he added.

"The Brazilian (power) system is very sophisticated and must have levels of protection ... so that one random element cannot cause a problem," he said. Interim Mines and Energy Minister Marcio Zimmermann also promised to take action to prevent such accidents.

Last week's blackout was the largest and most recent in a spate of similar accidents since late September, including one that forced the Federal Supreme Court to adjourn for several hours in a corruption trial.

The state of Brazil's energy supply network is now a prime concern for the government, especially as the nation is gearing up to host major world sporting events, including the 2014 FIFA World Cup and the 2016 Olympic Games.