Germany is set to phase out all its coal-fired power stations by 2038, under a plan agreed by a government-appointed commission early on Saturday. The keenly-awaited deal calls for massive financial transfers — worth €40bn over the next 20 years — to regions in Germany where coal mining and coal power still play a significant role.  The commission also wants Berlin to shield households and the private sector from the expected rise in electricity prices triggered by the phase-out, a move that could cost the government a further €2bn a year.

The plan — if implemented by the government in the years ahead — would see Germany join a growing number of countries around the world that have decided to end the use of coal, a key source of greenhouse gas emissions.  Berlin has long been viewed as a laggard in the campaign to phase out coal, denting the country’s credibility as a champion in the fight against climate change. Germany’s reluctance to shut down its coal plants before 2030, the target date for many green campaigners, reflects the fact that Berlin has already decided to exit nuclear energy by 2022, a move that takes out another reliable source of power.

Environmental groups on Saturday gave a guarded welcome to the deal: “Germany finally has a road map towards becoming coal-free. There will not be any new coal-fired power stations,” said Martin Kaiser, the director of Greenpeace Germany. “But the [commission] report has one severe flaw: the speed is not right. To exit coal only by 2038 is not acceptable to Greenpeace.” The struggle over how and when to end the use of coal and lignite — also known as brown coal — has roiled German politics for years.

The two play a crucial role in the country’s energy mix, and accounted for almost 40 percent of electricity produced in the country last year. The lignite industry, in particular, is a crucial provider of mining jobs in economically weaker eastern Germany.  Industry leaders have warned that a hasty phase-out of coal could lead to a dramatic spike in power prices and raise the risk of black-outs. Green campaigners insist that a speedy end to coal power is necessary for Germany to meets it climate change goals.

Berlin has committed to reducing carbon dioxide emissions from the energy sector by more than 60 percent by 2030, using 1990 as the baseline. Reaching that 2030 goal is seen as a priority not least because Germany has already admitted it is on track to fail its 2020 emissions targets — a severe embarrassment for a country that once prided itself on its green leadership.