Germany will pay top energy companies a total of 2.4 billion euros ($2.9 billion) in compensation for its decision to exit nuclear energy in the wake of the 2011 Fukushima disaster, Berlin said Friday.

By the end of 2022, Germany will have achieved its goal of completely phasing out nuclear power, set by Chancellor Angela Merkel after a deadly earthquake and tsunami caused a devastating meltdown at Japan's Fukushima plant.

"The government has reached an agreement with EnBW, E.ON/PreussenElektra, RWE and Vattenfall," Germany's environment, finance and economy ministries said in a joint statement.

They said Berlin would pay 2.43 billion euros compensation to the four companies, all of which operate nuclear power plants in Germany.

The companies welcomed the agreement on Friday, with RWE saying it was "a step towards legal certainty for all parties".

The payments, agreed after a long legal battle with the government, will cover both the cost of electricity the companies would otherwise have produced and investments they had made before Germany decided on its nuclear departure in 2011.

"The agreement has no impact on the exit from nuclear power. It is still the case that the last German nuclear plant will be shut down by the end of 2022 at the latest," the statement added.

- 'Acceptable' -

The plan was met with widespread public support in a country with a powerful anti-nuclear movement, fuelled first by fears of a Cold War conflict and then by disasters such as Chernobyl and Fukushima.

Yet it represented a dramatic change of course by Merkel's ruling conservatives, who just a few months earlier had agreed to extend the lifespan of Germany's oldest power stations.

Power companies dismayed by the nuclear U-turn immediately sued and won a court order for government compensation.

Berlin in 2018 then set out conditions for a payout which would run to hundreds of millions of euros but was ordered to revise it by Germany's highest court in 2020.

Ruling on a case brought by Swedish group Vattenfall, the constitutional court said the plan was "unreasonable" as it required energy companies to make changes to move away from nuclear power first before knowing how much compensation they would receive.

In Friday's statement, Berlin said the latest agreement would "put to rest" all the legal disputes and oblige the energy companies not to bring further cases.

Vattenfall confirmed it would be dropping its case, saying that Friday's agreement was a "conservative" but "acceptable" application of the constitutional court ruling.