Media playback is unsupported on your device Media caption Michael Niggli, president of San Diego Gas and Electric: "We expect customers to be out for quite a while."

A massive power cut has caused blackouts in the US states of California and Arizona, and in Mexico.

Five million people were without power on Thursday, with many likely to remain out of service for another day or two.

There was traffic chaos. San Diego was the worst affected city, where all outbound flights were cancelled.

An investigation is looking into why the blackout spread from Arizona, where a piece of equipment was switched off. Extreme heat may be a factor.

There's no doubt this has never happened before to our system Mike Niggli, San Diego Gas and Electric

'Like an oven'

Officials say that a power line between Arizona and California was knocked out of service after an employee carried out a procedure at a substation in Arizona.

"There appears to be two failures here - one is human failure and the other is a system failure. Both of those will be addressed," said Damon Gross, a spokesman for APS.

Daniel Froetscher, a vice-president at APS, told the Associated Press news agency it was "not a deliberate act".

"The employee was just switching out a piece of equipment that was problematic," Mr Froetscher said.

In Los Angeles, trains were stopped because there was no power for lights and signalling, and a number of people had to be rescued from stuck elevators and theme park rides.

California's two nuclear reactors were forced to shut down.

Image caption Traffic ground to a halt across San Diego

Police in San Diego used generators to take emergency calls, and officials said schools and city trains would be closed on Friday as a precaution.

"There was a very major outage, a region-wide outage," San Diego Gas and Electric President Mike Niggli said. "There's no doubt this has never happened before to our system."

Many residents complained of the stifling heat in the absence of air conditioning.

"It feels like you're in an oven and you can't escape," Rosa Maria Gonzales, a spokeswoman for the Imperial Irrigating District in eastern California, was quoted as saying by the Associated Press.

The blackout also affected cities across the border in Mexico's Baja California state.

Traffic lights were knocked out in Tijuana, while hospitals and government offices lost power. The border crossing at Otay Mesa was closed to all but pedestrian traffic, according to AP.

Mexico's Federal Electricity Commission said 180,000 customers had been brought back online in the state and said they were working to restore the rest, Reuters reports.