Germany has agreed to shut down all coal-fired electricity plants by 2038.
Germany has agreed to close down all coal-fired electricity plants by 2038.
A 28-member commission came to the agreement after 21 hours of talks which ended early on Saturday morning.
Those taking part said it was an important move.
One of the four leaders of the commission was Roland Pofalla, a Christian Democratic Union politician.
"It's done!" he said. "96.4 percent of the members of the commission have approved this draft, which was finally discussed overnight.
"If we actually implement this - and we believe that it is possible - then we would be back in the top group of the few countries that will fulfil this international agreement of goals by 2030."
Germany has failed to meet targets set out in the 2015 Paris climate agreement and still produces almost 40 percent of its electricity from coal.
During the talks, energy companies said they were worried about financial losses and demanded compensation.
Representatives of coal-producing regions also insisted on financial commitments which would help them change of a reliance on fossil fuels.
The plan will need to be given the go-ahead by the government but individual states will be responsible for its implementation.