Preliminary results in the German election show the centre-left social democrats have beaten outgoing chancellor Angela Merkel’s centre-right bloc.
SPD won 25.8% to the CDU/CSU’s 24.1%, according to figures from German broadcaster ARD and Reuters.
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 two bigger rivals to form a majority 50% government.
Right-wing populist party AfD came fifth with 10.4%.
In the running to become the next chancellor is CDU/CSU bloc’s Armin Laschet and outgoing finance minister Olaf Scholz for the Social Democrats.
The greens, with candidate Annalena Baerbock, are also making their first run for the chancellery.
Germany election: Angela Merkel’s party has been castigated in the polls – and CDU activists are not happy
German election: Merkel leaves Germany as indisputably the senior leader of the West
German election: Angela Merkel’s party ‘hurt’ as exit polls show leadership rivals are closely tied in vote to decide next chancellor
Germany could face months of talks over a coalition, meaning Mrs Merkel is required to stay on in a caretaker role.
Speaking after exit polls were revealed, Mr Laschet said: “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.
“It will probably be the first time that we will have a government with three partners.”
CDU general secretary, Paul Ziemiak, acknowledged the party had seen “bitter losses” compared with the previous election which saw it gain 32.9% of the vote four years ago.
He suggested it would be a “long election evening” but hinted at the possibility of working alongside the Greens and Free Democrats.
Meanwhile, social democrat counterpart, Lars Klingbeil, declared his party “is back” having previously secured just 20.5% in 2017.
Please use Chrome browser for a more accessible video player
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.