BERLIN, Nov 23 (Reuters) - Germany's Social Democrats (SPD), Greens and Free Democrats, who are negotiating to form a new government, have agreed to commit to a coal phase-out by 2030 in a coalition deal, sources involved in the talks told Reuters on Tuesday.

The three parties are in the final stages of clinching a coalition agreement and hope to present the deal on Wednesday, one source close to the talks said.

Climate policy is one of the closest-watched areas for the new government as Europe's biggest economy shifts towards carbon neutrality.

The three parties have also agreed to end power generation from gas by 2040, sources involved in the coalition talks told Reuters. In addition, gas heating systems would be banned in new buildings and replaced in existing buildings, they said.

An end to sales of new combustion engine cars would come by 2035, coinciding with European Commission plans, said the sources. The Greens had wanted an earlier date.

They have also agreed to form a beefed-up climate ministry to include core elements of the current economy ministry, such as industry and energy policy, the sources said.

If the parties finalise a deal, the SPD's Olaf Scholz would take over as chancellor from the conservative Angela Merkel, who did not stand for a fifth term in a Sept. 26 election.

The leaders of the three parties were due to meet on Tuesday in Berlin to discuss outstanding areas of disagreement and hope to conclude the negotiations on Wednesday, although they could still run into Thursday, a source with knowledge of the talks told Reuters.

While the Greens and SPD are widely seen as natural centre-left partners, the FDP have historically been closer to Germany's conservatives.

In particular, the Greens and FDP have been at odds over how to finance an expansion of renewable energies and how to bring forward an exit date for coal-fired power plants. (Reporting by Markus Wacket; Writing by Kirsti Knolle and Madeline Chambers; Editing by Raissa Kasolowsky)