German Chancellor Angela Merkel arrives for the last day of the coalition talks between her conservative bloc and the Social Democrats in Berlin on Tuesday. (Gregor Fischer/AP)

After a grueling all-night negotiating session, Germany’s two leading parties reached agreement Wednesday to once again form a governing coalition, after inconclusive elections in September left the country mired in political gridlock. 

The four months of wrangling and repeated failures to come up with a coalition have weakened Germany, and particularly Chancellor Angela Merkel, at a time when Europe is seeking a strong leader.

The talks between Merkel’s bloc — an alliance of the Christian Democratic Union and the Christian Social Union — and the Social Democrats (SPD) extended past a self-imposed Sunday deadline and a two-day grace period into Wednesday morning, when party leaders finally overcame differences on key issues such as health care and labor policy. 

One last hurdle remains, however: The Social Democrats have insisted on a partywide vote on the final deal, and the party’s youth wing has been actively recruiting members to vote against it.

An approval vote by party members is not unprecedented in Germany, but it is not standard practice, either, said political scientist Thorsten Faas of the Free University in Berlin. In 2013, the SPD membership was also allowed to vote on the coalition with Merkel’s conservatives. 

“It shows that the leadership was, and still is, in a rather weak position,” Faas said.

A weak leadership is also more susceptible to opposition — with a renewed coalition government, the far-right populist Alternative for Germany, or AfD, would become the strongest opposition party in Germany’s parliament.

In a country that kept the far-right restricted to the political sidelines for more than half a century, the rise of the AfD marked a watershed moment last September. The AfD won’t be in a position to drive a legislative agenda, but the electoral result gave it something the far-right had always been denied: parliamentary legitimacy on a national level.

As the only anti-immigration party in a mostly consensus-based national parliament, the AfD can also hope to further sharpen its profile as an alternative to Merkel.

On Wednesday morning, German media reported that the new coalition would grant the Social Democrats the Finance, Foreign and Labor ministries, with their leader, Martin Schulz, as foreign minister and Hamburg Mayor Olaf Scholz as finance minister and vice chancellor.

Schulz, the SPD head, plans to hand over his party leadership post to parliamentary group chief Andrea Nahles, according to the center-left daily Süddeutsche Zeitung. Nahles would be the first female leader in the party’s history, and she would be tasked with reuniting a party that is deeply divided over the proposed coalition treaty with Merkel’s conservatives.

Just days after the inconclusive September elections, Schulz told German media: “I won’t enter into a government with Angela Merkel.” His back-and-forth statements appear to have hurt the party’s credibility: Voter support is at 18 percent, according to surveys by the polling institute Forsa.

The SPD’s youth wing has also grown impatient with the party’s direction. Left-leaning activists recruited new party members to vote against the coalition, drawing heavy criticism from the Social Democrats’ coalition advocates.

SPD members will be asked to vote on the treaty in about three weeks. Tarik Abou-Chadi, an assistant professor at the University of Zurich and the Center for Democracy Studies in Aarau, Switzerland, cautioned that the growing number of SPD members may not necessarily reflect an attempt to derail a coalition government, as some critics have suggested.

“It’s also a sign of a general push among Germans to become more politically active,” he said.

Other analysts cautioned against underestimating the party base. “So far, the party membership has been relatively hostile to the idea of another four years under Ms. Merkel,” wrote Pepijn Bergsen, an analyst with the Economist Intelligence Unit. “However, voting down the agreement would probably result in another election, in which the SPD risks slipping to third place behind the far-right populist Alternative for Germany (AfD), from second currently, according to recent polls.”

Last weekend, the conservatives and the Social Democrats agreed on key housing policies, such as stricter regulations on rent ceilings in major cities; a 2 billion-euro investment in subsidized housing; and funds to help young families construct private homes — all points the Social Democrats had promised their base they would renegotiate with Merkel’s party. 

The negotiating partners also agreed on major steps toward expanding broadband reach and speed by 2025, a plan to patch holes in cellular data coverage and forming a new data ethics commission. 

If the SPD members back the final treaty, a new government will go into effect in late March or early April. If they don’t, Merkel will probably be forced to form a minority government, and that could mean the end of Schulz’s career and even Merkel’s, according to Faas. 

Over the past four months, many Social Democrats have spoken out against entering coalition talks at all, arguing that Merkel’s bloc would dilute their attempt to carve out a new, independent political identity after the party’s support dropped below 20 percent in the September elections — a record low in its postwar history.  

Years of coalitions with the conservatives had damaged their standing with voters, they said.

Merkel is entering her fourth term, and she and the SPD have failed to generate much excitement about their parties’ renewed partnership in governing. A Süddeutsche Zeitung editorial deemed the renewed partnership a “Coalition of Losers,” adding that the party leaders “aren’t protagonists of the future, but of the past.”

“Effectively they’re representatives of a ‘carry on’ politics, even if they promise change all day long,” the paper said.