Britain risks running out of energy generating capacity in the winter of 2015-16, according to the energy regulator Ofgem.
Its report predicted that the amount of spare capacity could fall from 14% now to only 4% in three years.
Ofgem said this would leave Britain relying more on imported gas, which would make price rises more likely.
The government said that its forthcoming Energy Bill would ensure that there was secure supply.
Ofgem blames the risk on coal-fired power stations being closed sooner than expected and EU environmental legislation.
The warnings come in Ofgem's first annual Electricity Capacity Assessment.
It comes three years after Ofgem's Project Discovery report, which warned that electricity shortages could lead to steep rises in energy bills.
It is now saying the highest risk of shortages would be sooner than expected because coal-fired power stations would be closing sooner than it had predicted in 2009.
The regulator said more investment was needed in building fresh generating capacity.
"The unprecedented challenges in facing Britain's energy industry… to attract the investment to deliver secure, sustainable and affordable energy supplies for consumers, still remain," said Ofgem chief executive Alistair Buchanan.
"Ofgem is working with government on its plans to reform the electricity market to tackle these issues."
Energy Secretary Ed Davey said the government would respond to the report before the end of the year.
"Security of electricity supply is of critical importance to the health of the economy and the smooth functioning of our daily lives," he said.
"That is why the government is reforming the electricity market to deliver secure, clean and affordable electricity."
Energy UK, which represents the energy industry, said Ofgem was right to highlight the challenges it faces in the coming years.
"We must secure over £150bn of investment in the UK to replace aging power stations and infrastructure, keep the lights on and meet our carbon targets," said its chief executive Angela Knight.
"All while making sure that energy bills are affordable for the millions of homes and businesses that rely on the power supplied by our members."
The trade union Prospect, whose members include 21,000 professionals working in nuclear decommissioning and energy supply, called for government action to avert power shortages.
"This report highlights how imperative it is for the government to act now and introduce electricity market reform that ensures the programme of new nuclear build and other vital energy infrastructure projects, such as carbon capture and storage, are attractive enough to secure the long-term investment they require," said Prospect general secretary designate Mike Clancy.
Audrey Gallacher, director of energy at Consumer Focus expressed concern about the dangers of rising prices.
"While there is enough generation capacity to mean that widespread power-cuts are still unlikely, narrower margins mean the risks of outages are higher and scarcity of energy could also feed into possible price rises in future," he said.
"Consumers need protection from price spikes as well as power cuts."
Source: BBC 5 October 2012 Last updated at 13:34