The Hinkley nuclear power deal contains a “poison pill” which could leave taxpayers with a £22bn bill if a future UK government closed the plant before 2060, according to an official document seen by the Guardian.

The huge liability shows Hinkley is a “terrible deal” for the UK public, according to critics, with the company also guaranteed three times today’s price for electricity for 35 years. The project has recently been battered by financial warnings and resignations at its prime backer EDF, although on Thursday France’s economics minister, Emmanuel Macron, said that the French state would bail the company out.

The deal the UK government has agreed with EDF, set out in an unpublicised “minute”, commits the British public to pay subsidies of up to about £40bn in real terms and provides state guarantees on nuclear waste disposal and insurance, while allowing the plant to begin producing electricity as late as 2033.

A shutdown that triggers the “poison pill” compensation is not entirely within the control of the UK government but could also be forced by the EU or an international regulator such as the International Atomic Energy Agency, according to the document.

Text of the contract between the UK government and EDF for Hinkley Point C. Photograph: UK government

“This is a dreadful agreement for the nation,” said Prof Catherine Mitchell, an energy policy expert at the University of Exeter. “The government is already paying a high price, index-linked for an incredibly long 35 years. This should be more than sufficient for a professional, business contract.

“The £22bn ‘poison pill’ effectively reduces the risk to zero for EDF and its backers, which is great for them. But from an outside perspective, it smacks of desperation.”

“There could be so many reasons over 35 years that you would want to close the plant,” she said, including rising costs, changes to the UK’s energy system or loss of public confidence.

Green party MP Caroline Lucas said: “Even before we knew about this ‘poison pill’, Hinkley represented a terrible deal for taxpayers and a huge burden on bill payers too. This flies in the face of relentless ministerial rhetoric on value for consumers – especially compared to the costs of solar power and wind – which are already cheaper than nuclear and continue to fall.”

A spokeswoman for the Department of Energy and Climate Change said: “Hinkley Point C will give a boost to our energy supply and our economy, bringing in billions of pounds of investment into the UK and creating 25,000 jobs during construction. The [deal] gives developers the certainty they need to make sizeable investments like this one, by providing protection for a political risk that is outside of their control. All [such deals] include protection against political shutdown, but this is extremely unlikely to happen.”

The £22bn is the maximum that would be payable and the deal allows the plant to be closed on safety or security grounds without compensation being paid.

“EDF and its Chinese partner are taking the construction risks for this huge project,” said an EDF spokesman. “Consumers will not pay a penny until the plant generates its reliable low-carbon electricity in 2025.”

EDF said in 2007 that the new nuclear reactors at Hinkley Point in Somerset would be providing power to cook Christmas dinners in 2017, but it has repeatedly delayed its final investment decision. It has yet to complete a reactor employing the new design intended for Hinkley, with projects in France and Finland hugely over budget and years behind schedule.

In recent weeks, EDF’s finance director quit over concerns about the project’s impact on the already heavily indebted company and EDF had to ask its owner, the French state, for increased support. MPs will grill EDF’s boss next Wednesday, and say there are “serious questions” to answer about Hinkley’s viability. But François Hollande and David Cameron have strongly backed the project as “a pillar of the bilateral relationship” and “a key aspect of Britain’s energy policy”.

Former Conservative energy secretary Lord Howell has criticised the Hinkley deal as “one of the worst deals ever” for British consumers and industry and has protested against “endless government guarantees for risk-free returns to the investors”.

Tom Burke at thinktank E3G, a former special adviser to three Conservative environment secretaries, said: “Why would a Conservative government want to buy 35 years of electricity ahead of time? They are supposed to believe in the market. But they have tied themselves in knots and now it is too embarrassing to untie it.”

The UK government argues that new nuclear power is essential to provide large amounts of reliable, low-carbon energy.

But Mitchell said: “Energy economics are changing rapidly and so the momentum is towards decentralised, smart and flexible energy systems. It is moving away from large, inflexible power plants like Hinkley. If it ever gets funded, it will be a white elephant before it is even finished and this government, with this £22bn ‘poison pill’, will have tied the next generation into paying for it, for no reason that I can understand. If it is simply political saving face, it really is pitiful.”