Germany, one of the world’s biggest consumers of coal, will shut down all 84 of its coal-fired power plants over the next 19 years to meet its international commitments in the fight against climate change, a government commission said Saturday.

The announcement marked a significant shift for Europe’s largest country — a nation that had long been a leader on cutting CO2 emissions before turning into a laggard in recent years and badly missing its reduction targets. Coal plants account for 40% of Germany’s electricity, itself a reduction from recent years when coal dominated power production.

Coal mine

“This is an historic accomplishment,” said Ronald Pofalla, chairman of the 28-member government commission, at a news conference in Berlin following a marathon 21-hour negotiating session that concluded at 6 a.m. Saturday. The breakthrough ended seven months of wrangling. “It was anything but a sure thing. But we did it,” Pofalla said. “There won’t be any more coal-burning plants in Germany by 2038.”

The plan includes some $45 billion in spending to mitigate the pain in coal regions. The commission’s recommendations are expected to be adopted by Chancellor Angela Merkel’s government.

Read more: LA Times