It took hours, but Germany finally agreed on a plan to close its coal power plants and rely heavily on renewable energy sources.

The country will shut down 84 coal-based power plants — that's all of them — by 2038 a government group decided on Saturday. The commission convened in Berlin to map out how to move away from coal.

Fossil fuels still account for about 40 percent of Germany's power, according to The Guardian, despite recent gains in renewable energy sources. The country also plans to move away from nuclear energy by 2022. Once it gets there, renewable energy will be the main source of power.

The 2038 goal will cost $45 billion, according to the Los Angeles Times. The decision comes ahead of an energy report from the German coal commission to be released on Feb. 1.

Around the world Saturday, climate change activists held die-ins and other protests to spur government action like Germany's plan.

A look at U.S. coal consumption shows we have a ways to go. In 2018 the U.S. consumed 691 million tons, down from a 2007 peak, but it's still a heavy user. China is also consuming tons of coal numbering in the billions: 3.82 billion metric tons in 2017.

The UK is racing ahead with renewable sources now that coal provides only 5 percent of energy.