Germany should shut down all of its coal-fired power plants by 2038 at the latest, a government-appointed commission said on Saturday, proposing at least 40 billion euros ($45.7 billion) in aid to regions affected by the planned phase-out.

The commission's plans are at the center of Germany's strategy to shift to renewables, which made up more than 40 percent of the energy mix last year, beating coal for the first time.

The proposals of the coal commission, which were finalized after more than 20 hours of last-round talks, will serve as a guideline for the government in its effort to turn the planned exit from coal into law.

The body agreed a total of at least 40 billion euros should be provided in aid for coal-mining states affected by the exit, less than the roughly 60 billion euros they had asked for.

"This plan will make it possible to achieve climate change goals set by the German government, but it will also, and this is important, achieve affordable and secure energy supplies if the German government implements our recommendations," said Barbara Praetorius, an environmental professor who served as one of the four leaders of the commission.

"A large majority of the population stands behind this exit from coal ... but it must be reliable, affordable and acceptable for the regions."

In a first step, plant operators including RWE , Uniper, EnBW and Vattenfall will be asked to shut down about 12.7gigawatts (GW) of capacity by 2022, equivalent to about 24 large power station units, the report, seen by Reuters, said.

Under the proposed plans, coal power capacity in Germany would more than halve to 17 GW by 2030.

"The commission recommends a mutual agreement with the operators on a contractual basis with regard to the shutdown," the report said, adding this would include agreeing on the exact size of compensation.