PARIS — As Germany’s Social Democrats lick their wounds after a historic defeat, they face the same question wracking the mainstream left across Europe and the United States: How did we lose the workers? And can we ever win them back?

Once, the West German SPD boasted a rock-solid base of unionized, industrial, working-class voters. Allied with the progressive middle class and young people, the party of Willy Brandt and Helmut Schmidt polled close to or above 40 percent from 1965 to 1983. As recently as 2002, it still won 38.5 percent in reunited Germany, sufficient to lead a governing coalition.

On Sunday, the list led by former European Parliament President Martin Schulz polled just 20.5 percent — the SPD’s worst score since World War II — due to mass defections in traditional heartlands.

The party’s biggest setbacks were in northern cities such as Hamburg and Bremen and former industrial bastions in the Ruhr region of western Germany such as Essen, Gelsenkirchen and Dortmund, where losses of 8-10 percentage points were triple the national average.

The slump mirrors the catastrophic results of moderate-left parties around much of Western Europe, as traditional supporters defect to populist anti-immigration movements, hard-left anti-globalization forces or abstention.

For the SPD, the decline began when the German Greens started to peel away “lifestyle liberals” in the 1980s.

In Germany, pollster Infratest Dimap estimated that former SPD voters defected in almost equal numbers to the far-right Alternative for Germany (AfD), the liberal Free Democrats (FDP), the hard-left Die Linke and the Greens. The nativist AfD — a sister party to Marine Le Pen’s National Front in France and the Dutch Freedom Party of Geert Wilders — polled 12.6 percent to enter the Bundestag for the first time, riding a wave of hostility to immigration, refugees, Islam and the European Union.

It’s a trend that has played out across the Continent. France’s Socialists and the Dutch Labor Party both suffered decimating defeats this year, bleeding support to anti-immigration Islamophobes, Euroskeptics, centrist modernizers and hard-left anti-globalization parties. Meanwhile, Spain’s Socialists have lost ground to the far-left Podemos and to Catalan nationalists.

The same forces led many lifelong working-class British Labour Party voters to vote for the U.K. to leave the EU. And there’s an echo in the U.S., where “America first” President Donald Trump won over many white working-class voters from the Democrats with a nationalist, anti-immigration, anti-globalization campaign.

Identity politics

According to Piero Ignazi, a lecturer in comparative politics at Italy’s Bologna University, the main battleground of Western politics has shifted away from class-based issues to matters of identity, culture and lifestyle, partly because of the success of social-democratic welfare policies in improving living standards and working conditions.

“Political conflict in the West since the end of the 20th century was based not only on class struggle but also on cultural issues, cosmopolitanism versus closed nationalism,” he said at a debate at the Lector in Fabula European cultural festival in Conversano, Italy. “Workers no longer live and work in the same conditions in Germany, France, Italy or Greece. Traditional workers don’t feel represented anymore and ask why left-wing parties no longer deal with their problems.”

For the SPD, the decline began when the German Greens started to peel away “lifestyle liberals” — younger, pacifist and environmentalist voters — in the 1980s. Having lost the organic muesli-eaters, the party went on to alienate beer-and-wurst Sozis. Starting in 2004, many working-class and leftist voters defected to Die Linke in protest of former SPD Chancellor Gerhard Schröder’s neoliberal reforms of labor laws, unemployment benefits and pensions.

Schröder’s Agenda 2010 reforms laid the foundation for Germany’s economic recovery over the last decade, but they hurt many core left-wing voters and fostered a generation of “mini-jobs.” More recently, the SPD’s embrace of multiculturalism and gay marriage cost it some traditional supporters.

“The old working class is disappearing historically, and therefore left-wing parties need to look for other voter groups in the middle classes,” said Colin Crouch, emeritus professor of sociology at Britain’s Warwick University.

After serving as junior partners in governments led by conservative Chancellor Angela Merkel for eight of the last 12 years, the Social Democrats were unable to present themselves as a credible alternative.

They may have managed to force through some of their policies during their time in the outgoing grand coalition: a national minimum wage and earlier retirement for people who started work young. But Merkel took the credit for those social advances.

If Infratest Dimap’s model is right, nearly 900,000 SPD voters switched on Sunday to the AfD and the FDP. While those two parties have very different economic philosophies, they share a common aversion to Merkel’s decision to welcome more than 1.5 million refugees and other migrants in 2015-2016 and a refusal to help weaker eurozone partners financially.

As a result, the SPD joins the ranks of other European center-left parties at risk of tearing themselves apart — and possibly losing their souls — over how to win back the voters they lost.

Left behind?

Austria’s Socialist Party has adopted some of the anti-immigration rhetoric of the populist Freedom Party in order to survive. In Britain, Jeremy Corbyn has embraced Brexit and curbing immigration, as well as old-style tax-and-spend and nationalization policies, to try to revive Labour’s fortunes. He is aided by a first-past-the-post electoral system that gives a premium to big parties and punishes fragmentation.

On the Continent, where proportional representation dominates, the risks of a splintering of the left are far greater. In France, far-left leader Jean-Luc Mélenchon is positioning his anti-globalization, Euroskeptic movement as the sole real opposition to Macron’s labor market liberalization, at the risk of driving Socialist reformers into Macron’s arms.

The SPD may win back some lost voters simply by going into opposition and restoring a clearer left-right divide — but the four-way split in defections and the shifting class base of its electorate makes its task ever more complicated.

If the party is to make itself relevant to German workers, it will have to grapple with the changing nature of society and of work, as well as declining unionization and party membership.

“Whichever way the SPD moves, it’s going to lose people on the other side" — Researcher Andrew Watt

The questions the SPD will need to answer include: whether to protect job-for-life incumbents or favor precarious job-creation for the unemployed; how to provide credible social rights for a growing army of gig workers in service industries; how to share the cost of the welfare state in an aging society; and how to reconcile a diverse, tolerant community with a more traditional national identity.

Andrew Watt, a researcher with the German trade unions’ Hans-Böckler Foundation, suggests the left will need two parties that compete against each other but are able to compromise and form coalitions together. He pointed to the success of Portuguese Prime Minister Antonio Costa, who leads a minority Socialist government supported by two smaller communist and leftist parties.

“You have to have two fishing boats. One that tries to get back traditional voters in competition with AfD, Die Linke, Mélenchon and Front National,” he said. “And another party that competes with the CDU and the FDP, or with Macron, for the more comfortably-off working class, professionals, creatives and public sector workers.”

“You can’t say ‘we just have to push left now,’” he added. “Whichever way the SPD moves, it’s going to lose people on the other side.”

Paul Taylor, a contributing editor at POLITICO, writes the Europe At Large column.