SAO PAULO—Fire forced the shutdown of a transformer in a substation, causing a 30-minute-long power outage in five Brazilians states, the country's Electric Energy System Operator said Thursday.

The government agency said in a statement that Wednesday night's outage was caused by a fire in one of three transformers in the southern city of Foz de Iguacu.

The fire was quickly extinguished and the substation's three other transformers swung into action.

"There was no blackout, but a preventive and controlled shutdown," agency director Hermes Chipp told reporters. He said the cause of the fire is being investigated.

The number of people affected by the outage was not immediately available.

Chipp said that the country's electric grid undergoes regular maintenance "and problems such as this are rare.'

"But that does not mean they will not occur along Brazil's more than 62,000 miles (100,000 kilometers) of transmission lines," he added

Hours after Chipp spoke, the Brasilia Energy Company said another power outage hit the Brazilian capital on Thursday, leaving at least 1.7 million people without electricity during two hours, company spokesman Mauro Pinheiro said.

He said the outage was caused by a brushfire that damaged part of a transmission line on the outskirts of Brasilia.

About two weeks ago, a power outage caused by a flawed transformer hit six states in northeastern Brazil. More than 5 million people were left without electricity for at least 20 minutes.