Image caption Ofgem said the UK's energy sector faces "unprecedented challenges"

The danger of power shortages in the UK by the middle of the decade has risen, according to industry regulator Ofgem.

Spare electricity power production capacity could fall to 2% by 2015, increasing the risk of blackouts.

More investment in power generation and other action is needed to protect consumers, Ofgem said.

"Ofgem's analysis indicates a faster than anticipated tightening of electricity margins toward the middle of this decade," it said in a report.

Andrew Wright, the regulator's chief executive, said: "Britain's energy industry is facing an unprecedented challenge to secure supplies."

The global financial crisis, tough emissions targets, the UK's increasing dependency on gas imports, and the closure of ageing power stations were all contributing to the heightened risk of shortages, Ofgem said.

"Preventive action taken now will help protect consumer supplies," the report said.

Ofgem said this could include negotiating with major power users for them to reduce demand during peak times in return for payment.

Media playback is unsupported on your device Media caption Michael Fallon: "I can assure you, the lights are not going to go out"

Also, Ofgem suggested keeping some mothballed power plants in reserve in case of emergencies.

Several ageing power plants are due to close over the next few years.

National Grid said it welcomed consultation on the proposed preventive measures, and said it has been working with the Department of Energy and Climate Change.

"This does not mean that disruption is imminent or likely, but Ofgem, DECC and ourselves believe it appropriate to consider what measures could be taken in case margins deteriorate further," National Grid said.