Germany's centre-left Social Democrats took a narrow lead on Chancellor Angela Merkel's conservatives in Sunday's vote to decide her successor, partial results showed, sparking immediate claims from both sides to form the country's next government.

The epochal election ushers in the end of 16 years in power for Merkel, and also thrusts Germany, a byword for stability, into a new period of political uncertainty.

Finance Minister and Vice Chancellor Olaf Scholz, 63, of the SPD, has positioned himself as a safe pair of hands
Finance Minister and Vice Chancellor Olaf Scholz, 63, of the SPD, has positioned himself as a safe pair of hands AFP / Tobias Schwarz

With the conservative CDU-CSU alliance and the SPD each seeking to form governing coalitions in a race for power, Germany was up for a rocky few months that could blunt it on the international stage for some time.

Partial results published on public television showed Finance Minister Olaf Scholz's SPD with around 25.9 to 26.0 percent of the vote, followed closely behind by Merkel's Christian Democrats and their candidate Armin Laschet on about 24.1-24.5 percent.

Armin Laschet, of Merkel's conservative CDU-CSU alliance, is seen as an affable but gaffe-prone ally of the outgoing chancellor
Armin Laschet, of Merkel's conservative CDU-CSU alliance, is seen as an affable but gaffe-prone ally of the outgoing chancellor AFP / Ina Fassbender

The SPD swiftly staked its claim with general secretary Lars Klingbeil saying his party "clearly has the mandate to govern".

"It's going to be a long election night, that's for sure," Scholz said.

But he said it was "certain" that many Germans "want there to be a change in government and also... want the next chancellor to be called Olaf Scholz".

Billboards with election campaign posters showing the three chancellor candidates in the the September 26 federal election
Billboards with election campaign posters showing the three chancellor candidates in the the September 26 federal election AFP / John MACDOUGALL

With the conservatives staring down the barrel of their worst result since World War II, CDU general secretary Paul Ziemiak admitted that the "losses are bitter compared to the last election" in 2017, when the CDU-CSU under Merkel notched up 33 percent.

But Laschet, 60, warned that the jury was still out on which party will end up leading the country, as he vowed to "do everything we can to build a government led by the (conservative) Union".

German Chancellor Angela Merkel is bowing out after 16 years in power
German Chancellor Angela Merkel is bowing out after 16 years in power AFP / Ina Fassbender

Scholz and Laschet both said they would aim to cobble together a ruling majority by Christmas.

With all still to play for, the mood at both parties' headquarters was tense.

"I am disappointed that the SPD is more or less level with the CDU-CSU. But it remains exciting what coalition possibilities will now emerge," said Oliver Pawloski, 39, a member of the SPD.

After sixteen years in power and with popularity ratings that many politicians can only dream of, Angela Merkel is preparing to step down as chancellor, leaving a great void for Germany, the EU and the world despite a mixed record and legacy.
After sixteen years in power and with popularity ratings that many politicians can only dream of, Angela Merkel is preparing to step down as chancellor, leaving a great void for Germany, the EU and the world despite a mixed record and legacy. AFPTV / Marion PAYET

At the CDU, Alfons Thesing, 84, put the finger on the problem for his party. "It hurts a lot that Merkel is no longer there," he said.

Illustrating the poor showing for the CDU, Merkel's own Baltic coast constituency -- which she had held since 1990 -- was taken by the Social Democrats.

German Chancellor Angela Merkel is bowing out after 16 years in power
German Chancellor Angela Merkel is bowing out after 16 years in power AFP / Ina Fassbender

The SPD, Germany's oldest party, was polling so badly just a few months back that many had written off the possibility that it may even be in the next government.

Greens chancellor candidate Annalena Baerbock casts her ballot at a polling station in Potsdam
Greens chancellor candidate Annalena Baerbock casts her ballot at a polling station in Potsdam POOL / Ronny Hartmann

But Scholz, 63, a colourless but competent former mayor of Hamburg, now stands a chance of becoming the first SPD chancellor since Gerhard Schroeder, who lost to Merkel in a close contest in 2005.

It was a dramatic reversal of fortunes, considering that the conservatives' candidate Laschet went into the race as the clear favourite to grab the top job in Europe's biggest economy.

Laschet's popularity began to wane after a series of blunders over the summer, including being caught on camera laughing in the background during a tribute to the victims of devastating floods.

In the meantime, Scholz saw his ratings begin to rise as he capitalised on his proximity to Merkel as finance minister in her cabinet, and avoided making such embarrassing mistakes.

Alarmed by polls predicting a devastating defeat for Laschet, the conservatives trotted out their biggest asset -- Merkel.

Although she had originally planned to keep a low profile in the campaign, she found herself dragged into Laschet's frantic cross-country tour -- helping the party to stem a drop in popularity in the last days before the vote.

Although climate change had been one of the top concerns among voters in the run-up to the vote, it did not translate into a sweep for the ecologist Greens.

For political analyst Karl-Rudolf Korte, Sunday's outcome showed that there is "no clear climate for change -- rather it's a yearning for a new beginning but coupled with stability, more of the same".

The Green party enjoyed a surge in support earlier this year after naming 40-year-old Annalena Baerbock as its chancellor candidate, at one point even briefly taking the lead as the most popular party.

But after a series of missteps by Baerbock, including a plagiarism scandal, the Greens fell well behind the two leading parties, the early results showing them just under 15 percent of the vote.

While the chancellery may be out of reach for the Greens, the party will likely have a junior role in Germany's next government.

Both Scholz and Laschet will be seeking to woo the Greens. Likewise, they will be trying to get the liberal FDP on their side to make up the numbers.

As the FDP is a natural bedfellow with the conservatives rather than the centre-left, and the Greens in turn favour the SPD, a real game of poker could emerge in the next weeks.

Horse-trading had already begun with the count still on.