The decision clears the way for a re-run of the “grand coalition” which has governed Germany since 2013 and hands the Chancellor a fourth term in office.
It also puts an end to five months of political uncertainty in Europe’s largest economy – the longest the country has been without a government in its post-war history.
The centre-left SPD had furiously debated whether to extend the “grand coalition” for another four years after suffering a slump in last year’s election.
In the end, 66 per cent of the party’s 464,000 members approved a coalition deal.
Parliament is expected to meet next week to elect Ms Merkel as chancellor, confirming her position as one of Europe’s most dominant politicians.
Ms Merkel congratulated the SPD on a “clear result”.
“I congratulate the SPD on this clear result and look forward to continuing to work together for the good of our country,” she said on her Christian Democrats’ (CDU) Twitter feed.
Speaking at the SDP’s headquarters in Berlin, its acting leader Olaf Scholz said: ”The vast majority of SPD members followed the party leadership’s suggestion.”
“We now have clarity: the SPD will join the next German government,” he added.
On Saturday, Mr Scholz had said turn-out in the poll had been “very, very high” after an intense internal campaign that pitted the party’s pro-coalition leadership against its more radical youth wing, which campaigned for “No”.
Volker Bouffier, a senior CDU politician, welcomed the SDP vote, saying it was good for people in Germany and the country’s future.
“I’m pleased about the result of the SPD members’ vote,” he said in a statement. “Today is a good day for the people in our country and positive for the future of Germany.”
He said a stable government under Ms Merkel should now be formed quickly.
Ms Merkel could be sworn in as Chancellor by the middle of the month.