BERLIN (AP) — The German government said Friday it has agreed with four utility companies that they will receive a combined 2.4 billion euros ($2.9 billion) in compensation for the early shutdown of their nuclear power plants.

Germany is on course to phase out the use of nuclear power by the end of 2022. Six nuclear power plants that are still in use will need to be shut down before the end of their original operating life.

Some utility companies have sued the German government, arguing they should receive significant compensation for lost investments and the electricity they can’t generate from the plants due to the early shutdown .

In a joint statement the environment and economy ministries said that Swedish utility company Vattenfall will receive 1.425 billion euros. The German companies RWE, EnBW and E.ON/PreussenElektra will share the remaining 1 billion euros.

In return, the companies will have to drop all lawsuits, including a case that Vattenfall brought before a Washington-based international arbitration panel.

The deal needs to be finally approved by the companies’ boards and is subject to scrutiny from the European Union’s competition authority, which recently launched a probe into a similar agreement between Germany and coal-fired power plant operators.

According figures released Friday by the Federal Statistical Office, wind power became the top source of electricity in Germany in 2020. It accounted for 25.6% of the 502.6 terawatt-hours of electricity generated in the country last year, followed by coal with a share of 24.8%. Nuclear power accounted for 12.1% of the electricity generated in Germany in 2020.