Angela Merkel has secured her fourth term as Germany’s Chancellor, ending nearly six months of uncertainty since the last election.
Members of the Social Democrat Party voted in favour of joining a coalition, clearing the last major hurdle to forming a new government.
However, the veteran politician has given away some key roles in the government to secure the deal, which was put to members after last-minute crunch talks in February.
Olaf Scholz, the SPD’s acting leader, said: “This was a really important democratic decision for our country.”
He added: “We now have clarity, the SPD will enter the next federal government. The Social Democratic Party has not made this decision easy.”
On Twitter, Mrs Merkel wrote: “I look forward to working with the SPD again for the good of our country.”
The party had debated rejoining the grand coalition after suffering heavy losses in the September election.
But according to party treasurer Dieter Neitan, two-thirds of the 464,000 members who voted were in favour of the deal.
Parliament is expected to re-elect Mrs Merkel as Chancellor next week.
The SPD will put forward six names to lead the ministries they will control. It is understood they will be three men and three women.
Activists worked through the night to count the votes at the party’s headquarters in Berlin.
The SPD had initially ruled out another coalition, when they got just 20.5% of the vote in the September election, but the leadership campaigned for a yes vote to the new deal.
Mrs Merkel negotiated with other smaller parties, but one of those rejected a deal. German President Frank-Walter Steinmeier stepped in to urge the then leader of the SPD, Martin Schulz, to reconsider.
The members’ support for the deal dropped compared to 2013, when 76% voted in favour.