German Chancellor Angela Merkel's conservatives and the Social Democrats (SPD) agreed after all-night talks on Friday to a blueprint for formal coalition negotiations, party sources said, bolstering prospects for an end to months of political uncertainty.

The agreement between party and parliamentary leaders should pave the way for detailed negotiations in coming weeks, lifting the uncertainty that has undermined Germany's role in international affairs and raised questions about how long Ms Merkel will stay in her job.

After 24 hours of talks, the six leaders began presenting the 28-page blueprint to party members, party sources said.

Weakened by an election setback in September, Ms Merkel turned to the left-leaning SPD to renew their so-called "grand coalition" after the collapse in November of talks on a three-way coalition with the Greens and Free Democrats (FDP).

Related reading Germany's Merkel launches fresh bid to end political impasse

The chancellor, who commands wide respect abroad after more than 12 years in power, needs the talks to succeed to avoid further erosion of her personal authority and weakening of German international influence, not least in the European Union.

As Europe's largest economy and pre-eminent power broker, Germany is crucial to the region's fortunes.

Berlin's partners are eagerly awaiting a new German government to help drive forward Brexit talks, euro zone reform and EU diplomatic initiatives.

Ms Merkel has ruled with the SPD in two of her three terms in office, including in the last parliament from 2013-2017. A re-run of their partnership is not yet certain.

Before the two groups move to formal coalition negotiations, SPD leaders need to convince party members to give a green light at a congress planned for 21 January.

Many SPD members fear governing with the conservatives again would further weaken their party after it suffered the worst result in September's vote since the modern Federal Republic was founded in 1949.

Kevin Kuehnert, head of the youth branch of the SPD, said on Thursday he planned a 'NoGroKo' tour of Germany to persuade party delegates to vote against the grand coalition.