The electric power supply was restored in various parts of central Madrid on Monday after a mass blackout hit most of the Iberian Peninsula and caused disruptions for around eight hours.
The outage caused chaos in parts of Portugal and Spain as traffic lights stopped working, causing gridlock.
Transport networks were halted, hospitals were left without power and people were trapped in the metro and in elevators.
The Spanish and Portuguese governments met to discuss the outage, which also briefly affected parts of France, and a crisis committee was set up in Spain, sources familiar with the situation said.