The centre-left Social Democrats have narrowly beaten outgoing chancellor Angela Merkel’s centre-right bloc in a closely fought election, according to preliminary results.
SPD won 25.9% to the CDU/CSU’s 24.1%, according to figures released by election officials on Monday after the count for all 299 constituencies was completed.
The Greens were next with 14.6%, followed by the FDP on 11.5%.
The two parties have signalled they are willing to discuss a three-way alliance with either of their bigger rivals to form a majority 50% government.
Right-wing populist party AfD came fifth with 10.4%.
Hoping to become the next chancellor is CDU/CSU bloc’s Armin Laschet and the frontrunner, Olaf Scholz for the Social Democrats.
The Greens, with candidate Annalena Baerbock, are also making their first run for the chancellery.
No winning party in a German national election had previously taken less than 31% of the vote.
Germany could now face months of talks over a coalition, meaning Mrs Merkel stays on in a caretaker role.
Despite getting its worst-ever result in a federal contest, the CDU/CSU bloc said it would reach out to smaller parties to discuss forming a government.
Mr Laschet, governor of North Rhine-Westphalia state, said his party’s loss of votes “isn’t pretty” and conceded that the country would now probably end up with a three-way coalition.
But he added that with Ms Merkel departing after 16 years in power, “no one had an incumbent bonus in this election”.
Mr Laschet told supporters that “we will do everything we can to form a government under the Union’s leadership, because Germany now needs a coalition for the future that modernizes our country.”
Mr Sholz, outgoing vice chancellor and finance minister, said the result was “a very clear mandate to ensure now that we put together a good, pragmatic government for Germany”.
Both men will now be courting the Greens and pro-business Free Democrats (FDP) in the hopes of forming a union.
The Greens traditionally lean toward the Social Democrats and the Free Democrats toward the CDU/CSU bloc, but neither ruled out going the other way.
The FDP’s leader, Christian Lindner, appeared keen to govern, suggesting his party and the Greens should make the first move.
“About 75% of Germans didn’t vote for the next chancellor’s party,” Lindner said in a post-election debate on public broadcaster ZDF.
“So it might be advisable… that the Greens and Free Democrats first speak to each other to structure everything that follows.”
The other option is a repeat of the outgoing “grand coalition” of the CDU/CSU and Social Democrats that has run Germany for 12 of Merkel’s 16 years in power, but there has been little appetite for that after years of government squabbling.
Mr Laschet said: “Everyone thinks that… this ‘grand coalition’ isn’t promising for the future, regardless of who is No 1 and No 2. We need a real new beginning.”
Speaking earlier after exit polls, CDU general secretary Paul Ziemiak acknowledged “bitter losses” compared with the previous election where it gained 32.9% of the vote.
The SPD has also won the regional election to lead the state government in Berlin, according to preliminary results, meaning Franziska Giffey is set to become the first female mayor of the country’s capital.
Voting closed at 5pm UK time in a bitterly fought election to replace the country’s leader, who’s been in power for 16 years.
About 60.4 million people were eligible to elect the new Bundestag – Germany’s parliament – which will then choose the new chancellor.
Due to Germany’s complicated electoral system, a full breakdown of the result by seats in parliament was still pending.
Veteran leader Mrs Merkel has won praise for steering her country through several major crises, including the financial crash and the COVID pandemic.