Germany's Social Democratic Party has voted in favour of joining a coalition with Angela Merkel's conservative bloc, clearing the last major hurdle to the formation of a new government and a fourth term for the German chancellor.
The decision ends almost six months of uncertainty in German politics, the longest the country has been without a government in its post-war history.
The centre-left Social Democrats had furiously debated whether to extend the so-called grand coalition for another four years after suffering heavy losses in September's election.
In the end, two-thirds of the valid votes cast by its 464,000 members favoured a coalition deal, said party treasurer Dietmar Nietan, who oversaw the ballot.
"This was a really important democratic decision for our country," acting party leader Olaf Scholz told reporters in Berlin.
The Social Democrats will put forward six names - three women and three men - to lead the ministries they will control in the upcoming coalition in the coming days, he said.
Parliament is expected to meet next week to elect Ms Merkel as chancellor.
Activists at the Social Democrats' headquarters in Berlin had worked through the night to count the votes.
A "no" vote would have been a blow for the party's leadership - who campaigned for members' approval - and for Ms Merkel, who spent months negotiating with rival parties to form a new government.
After September's election, in which the Social Democrats received just 20.5% of the vote, then-leader Martin Schulz ruled out another grand coalition with Ms Merkel.
This forced Ms Merkel to negotiate with two smaller parties, one of which eventually rejected a deal.
Pressure from German President Frank-Walter Steinmeier prompted Mr Schulz to rethink and weeks of haggling between his party and Ms Merkel's bloc resulted in a coalition agreement.
Fewer Social Democrats approved the deal this time round than in 2013, when 76% of members backed a government with Ms Merkel.
Many Social Democrats, particularly on the left, had argued that the party failed to make its mark on the last government and would not benefit from propping up Ms Merkel for another term.