MEMBERS of Germany’s Social Democratic Party (SPD) have endorsed a new coalition with Angela Merkel’s Christian Democrats (CDU) and the Christian Social Union (CSU), their Bavarian sister party. That puts Germany’s long months of coalition wrangling to an end—the election was held on September 24th—and gives Europe’s largest economy a stable government. It also secures Mrs Merkel’s reappointment as chancellor, which is expected to take place in the Bundestag on March 14th.

Insiders had long predicted the vote of SPD delegates in January on whether or not the party should even enter formal talks with the CDU/CSU would be the higher hurdle (it was cleared with 56.4% of votes). But nerves jangled nonetheless in recent weeks. The Young Socialists, the SPD’s youth wing, had campaigned energetically for a “no” vote, arguing that yet another “grand coalition” (or “GroKo”, the likes of which has governed Germany for eight of Mrs Merkel’s 12 years as chancellor) would further damage the party, which obtained its worst result in the history of the federal republic last September. They had even recruited over 20,000 new and mostly GroKo-sceptic new members before the cut-off.

In the event, however, the party leadership and the rest of the “yes” camp won comfortably. Of the 363,494 eligible votes (a turnout of 78%) 239,604 were for forming a new government, or 66%. That was just ten points below the equivalent figure in 2013—when the party was much happier about joining Mrs Merkel—and testament in particular to the gutsy campaigning of Andrea Nahles, its leader in the Bundestag who is nominated to take over the leadership following the resignation of Martin Schulz, its failed chancellor candidate. The party will elect its new leader at a conference in April.

Most spots in the incoming grand-coalition cabinet are already allocated. Olaf Scholz, the SPD’s serving leader and outgoing mayor of Hamburg, will take the finance ministry—which was in CDU hands under Wolfgang Schäuble since 2009. In return the CDU takes the economics and energy ministry (which goes to Peter Altmaier, the serving finance minister) and keeps both the defence ministry (still under Ursula von der Leyen, another Merkel loyalist) and the health ministry (which goes to Jens Spahn, a critic of the chancellor tipped as a possible future CDU chancellor). Horst Seehofer of the CSU takes on an interior ministry expanded to include “homeland” matters. The only big question is which SPD figure will take the foreign ministry. It had been earmarked for Mr Schulz but following his withdrawal from top-level German politics may remain in the hands of Sigmar Gabriel; Katarina Barley, the families minister in the last government, is also mentioned.

Hammered out before the SPD members voted, the coalition deal provides a detailed overview of the new government’s agenda. Much of it concerns the disbursement of Germany’s giant budget surplus, which hit a record €37 billion last year. Child care will be expanded, there will be tax cuts for middle and lower earners, increased infrastructure investment and a push to improve internet connections. The SPD gets strict new limits on the use of short-term work contracts. Meanwhile the CDU/CSU’s agenda marks the law-and-order sections: refugee arrivals will be capped at an annual range of 180,000-220,000 and family-reunification will be limited to 1,000 a month plus “hardship cases”. Of a wider vision for Germany, and particularly its place in the world, there is relatively little.

The possible exception is Europe, on which the agreement promises an “awakening” of German policy, but is vaguer on the details. Though it leads the document, that section takes up just five of its 177 pages. There will be close co-operation with Emmanuel Macron on defence integration and tax harmonisation. The new government will increase Germany’s contribution to the EU budget; it even envisages a euro-zone budget one day. It supports the transformation of the European Stability Mechanism, the EU’s crisis firewall, into a parliamentarily controlled European Monetary Fund anchored in European law, though is not specific about what this should do. Some early progress on this front will be the incoming government’s top priority: the strongest argument of the pro-GroKo-ers was that the next few months, with Mr Macron secure in Paris and before the build-up to next year’s European Parliament election, offer a rare window to reform the EU. With a “no” vote that window would have closed before a stable new government took office in Berlin (the plan is to reach an initial Franco-German agreement in June). That, more than domestic political matters, is the most significant implication of today’s news.

It was on the domestic front that the anti-GroKo-ers had the best lines. A new grand coalition will not be particularly strong. The combined vote share of its constituent parties fell from 67% to 53% at the election; with the SPD’s further slump in recent weeks some polls even suggest it would be below 50% today. Mrs Merkel’s fourth term will almost certainly be her last; in Annegret Kramp-Karrenbauer, the minister-president of the Saarland last week appointed the CDU’s new general secretary, many spy the chancellor’s preferred successor (and in Mr Spahn, her most formidible prospective rival for the top job). Meanwhile the largest opposition party in the Bundestag will be the far-right Alternative for Germany party, which has picked up support in recent polls. Broader long-term trends, evident in the election, have not gone away: German politics is still fragmenting, society is still becoming more unequal, culture wars continue to gain ground, the once-mighty SPD is still in a crisis and long-term economic and geopolitical disruption still looms over the comfortable German homestead.

Nonetheless, today’s result also serves as a reminder not to overdo the gloom about Germany. It took a long time to reach a new government. But a new government has been reached. It will be stable and in some areas—Europe and investment, for example—will improve on the last. Mrs Merkel remains her country’s most popular politician and seems once more fully in command of her departure date. Another wave of political obituaries for her are today consigned to the filing cabinet, for another day.