OFGEM has demanded an urgent investigation into last night's power cut after "generator failures" left vast swathes of the nation in darkness.
A million people across the UK were affected after two National Grid generators conked out.
Large parts of London, the South East, Liverpool, Glasgow, Wales, Gloucestershire and Manchester were all left without power.
A major review has been launched into the blackout but the National Grid is "confident" that there was no "cyber attack" on the system.
OFGEM said: "In any incident the priority is to get power restored to customers as quickly as possible. National Grid has now informed OFGEM that the system has been restored.
"However, OFGEM understands the frustration this power cut has caused consumers.
"OFGEM has asked for an urgent detailed report from National Grid so we can understand what went wrong and decide what further steps need to be taken.
"This could include enforcement action."
Julian Leslie, Head of National Control at the National Grid Electricity System Operator said: "We had an unplanned near simultaneous event on our network.
"This event was the loss of two generators which connect to the national grid network in order to export their power.
"As a result of this, this rare event, the system needs to protect itself.
"What was happening was as the frequency was falling, the system could see this and unfortunately the way the system protects itself is to lose some demand.
"You would have seen this in a temporary and short power cut."
Professor Tim Green, co-director of the Energy Futures Laboratory, Imperial College London, believes the two generators disconnected were at Little Barford and Hornsea.
He said: "The first generator to disconnect was a gas fired plant at Little Barford at 16:58. Two minutes later Hornsea Offshore wind farm seems to have disconnected.
"This might be linked to disturbance caused by first generator failing; might not.
"We will need to wait for National Grid's full technical investigation to get to bottom of that."
Thousands of desperate passengers were stranded on trains for more than six hours in the dark last night as a UK-wide power cut wreaked havoc on trains, Tubes and roads.
Commuters described "apocalyptic" scenes when power failed around 5pm - even knocking out traffic lights in some areas.
Trains were stuck on Thameslink and the East Coast main line, with delays and cancellations continuing all evening.
"PANDEMONIUM"
Witnesses described "pandemonium" as cops were called to break up fights and passengers were forced to pee out of windows.
Christopher Lovell tweeted: "Been sat on a train outside Hatfield for 4.5 hours now.
"People have been p*****g out of the drivers door as there are no toilets.
"Completely unacceptable, multiple opportunities to evacuate the train while it was still daylight."
Vicki Hamilton said: "Over 4 hours later and still stuck on this @TLRailUK train with no water, no food and no power!"
Our video shows passengers being rescued after six hours stuck between Hatfield and Welham Green, Herts - as the driver says they are finally getting off this "nightmare train".
One traveller on board told The Sun Online: "It was pitch black, toilets were overflowing, people were shouting and children crying.
"It was pandemonium. After about five hours the police came to break up fights.
"People were smoking in the toilets and then squaring up to other people who objected.
"Passengers were on the point of revolt."
He said a diesel train was eventually brought alongside and workers helped them across the track.
After seven hours they reached Hatfield station and were put on buses to London.
He added: "A policeman told me they'd evacuated ten trains, and there were 50 trains stuck because of the power cut."
Other pictures show passengers walking on tracks in North London and in a London Underground tunnel.
Meanwhile at King's Cross 1,000 people were shut outside and others slept on the floor inside as train companies told ticket holders: "Do not attempt to travel."
Euston Station was also evacuated and people were stuck underground on the Victoria Line at the height of rush-hour.
Harriet Jackson said: "All the traffic lights were down, but there were no police present, which meant it was dangerous to cross - cars weren't stopping either.
"It was like witnessing something out of an apocalyptic film.
"No one knew what was going on and, given it's a Friday afternoon, it's the last thing you want to encounter."
Newcastle Airport also suffered a blackout. Scott McKenzie, 31, from Cardiff, said: "We were literally plunged into darkness and people were using their phones as torches to see and get around."
It was the first major outage since 500,000 lost power in London in 2003.
Western Power Distrubiton, which serves the Midlands, South West and Wales, said 500,000 people were affected.
More than 100,000 homes in Devon were left without power, and around 300,000 UK Power Networks customers were affected in London and the South East.
Northern Powergrid, which serves Yorkshire and the North East, said 110,000 customers lost power while Electricity North West said a further 26,000 customers were affected.
Later the National Grid said power had been "restored" after two generators failed, but energy watchdog Ofgem has called for an "urgent detailed report" so it can investigate.
A spokesman said: "Ofgem has asked for an urgent detailed report from National Grid so we can understand what went wrong and decide what further steps need to be taken. This could include enforcement action."
Tube passengers in London reportedly collapsed due to heat exhaustion after a Victoria Line train was stuck between Oxford Circus and Green Park for 25 minutes.
Meanwhile, cops were filmed boarding a train stranded at Potters Bar station in North London after the power went out to help with crowd control.
A British Transport Police (BTP) spokesman said: "We currently have BTP officers assisting at several stations owing to current disruption caused by power issues."
Network Rail said power outages sent their signals down, resulting in cancellations and delays in the Newport, Gloucester, Ashford, Bristol, Eastbourne, Hastings, Three Bridges and Exeter areas.
Rail operator Thameslink said many of its trains were "at a stand".
Commuters in Liverpool and Stockport in Cheshire also complained of power outages.
Meanwhile, passengers reported being "thrown off" an escalator after it suddenly stopped in Bradford, West Yorks.
As homes across London were plunged into darkness - sending mobile phones and the internet down - locals wrote: "It's scary as hell".
The drop in power also affected traffic lights in the capital, Transport for London confirmed.
It said: "Due to a large scale National Grid failure there is a power cut in the London and South East areas, meaning that some traffic lights are down.
"Please be very cautious on the roads!"
Last night there were reports the outage was caused by a failure of one gas power station and a major wind farm at the same time.
National Grid confirmed at around 6.40pm that the issue had been "resolved" - but the knock-on disruption lasted hours.
UK Power Networks said: "We're aware of a power cut affecting large parts of London and South East.
"We believe this is due to a failure on National Grid's network, which is affecting our customers."
The outage came as the country is lashed by heavy rain and thunderstorms - with severe weather warnings in place for almost all of the UK.
MOST READ IN NEWS
National Rail Enquiries said: "Power supply problems are currently causing disruption to a large number of train services. Information screens in some areas are also affected."
It added: "The UK power network has failed in the large parts of London and the South East. This has prevented trains across the Great Northern network and between Farringdon and Bedford from being able to take power and as a result, most trains are currently at a stand."
It's the second day of travel chaos for commuters in London as thousands were left stranded in Euston and Marylebone because of signal failures.
How to claim compensation for unplanned power cuts
IF you've been affected by a power cut then you could be owed cash. Here's all the details.
If the power cut was caused by bad weather, you should be paid compensation without having to claim.
But if you don’t receive the compensation you can claim it yourself by contacting your network provider.
How much can you get?
The amount of compensation you can get depends on how many homes were affected by the power cut, how long it last and whether it was caused by bad weather.
You can contact your network operator to find out how many homes were affected.
Compensation ranges from £35 up to a maximum of £700.
How to claim
You should be paid within 10 days of claiming, or if the power cut was caused by bad weather, you should be paid as soon as is reasonable.
If you’re not paid within these timescales, you can get a further payment of £30 for late payment.
If the network tells you that you’re not eligible for compensation, and you disagree, you should complain directly to it. Use its complaints procedure, which will be on its website.
If you’re not satisfied with the response to your complaint, you can complain to the energy ombudsman.
We pay for your stories! Do you have a story for The Sun Online news team? Email us at tips@the-sun.co.uk or call 0207 782 4368 . You can WhatsApp us on 07810 791 502. We pay for videos too. Click here to upload yours.