Germany's centre-left Social Democrats (SPD) have agreed to talks with their former coalition partners, Chancellor Angela Merkel's centre-right Christian Democrats (CDU).
Mrs Merkel has been unable to form a coalition since a September election.
Attempts to form a government fell apart last month after weeks of talks.
SPD leader Martin Schulz previously ruled out going back into coalition with the CDU, but on Thursday the party agreed to "open-ended" talks.
Delegates at a party conference voted for the move.
The two parties have ruled together since 2013 but at September's election the SPD got its worst results since 1949, leading Mr Schulz to vow they would go into opposition.
Since the CDU's talks with the liberal FDP and the Greens fell down, the SPD has come under intense pressure to join coalition-building talks.
On Thursday, Mr Schulz told his party: "We don't have to govern at any price, but we must not reject governing at all costs either."
He promised to be an advocate of the European Union, calling at one point for for a United States of Europe "by 2025" and saying right-wing nationalists would win otherwise.
Mrs Merkel said in response that her goal was better co-operation between countries, not a federal Europe.
Talks are due to begin next week, and could lead to another "grand coalition" between the two big parties, to a minority government led by Mrs Merkel, or to new elections.
The delay in forming a new coalition - the biggest crisis of Mrs Merkel's career - has worried some European Union allies who see Germany as a pillar of stability in the bloc.
Germany's Spiegel newspaper has billed it as a fight for Mrs Merkel's political survival.
What could happen?
- The SPD could join Mrs Merkel in a coalition
- Mrs Merkel could form a minority government with the Greens, with SPD support. But the chancellor previously said she preferred new elections to an unstable minority government
- President Frank-Walter Steinmeier could call a new election, but experts say the chances of this happening are remote after the SPD agreed to talk. Polls suggest a new vote would produce a result similar to September's election. There is also the fear that the far-right Alternative for Germany (AfD) could benefit the most