Sweden's prime minister and the leader of the Social Democrat Party, Stefan Löfven, speaks at an election party on September 9, 2018.TT News Agency / Jonas Ekstromer / Reuters

ENKÖPING, Sweden — Four days before Swedish voters went to the polls, Pedro Sánchez, the prime minister of Spain, took the stage at a rally in this small town 40 miles northwest of Stockholm. Sánchez was in town to offer his pitch for Sweden’s Prime Minister Stefan Löfven, a fellow center-left politician and the head of Sweden’s Social Democrats. The Swedish Social Democrats, Sanchez argued, were no mere national party: They offered a “message of hope” for like-minded parties across Europe, and their success or failure would echo far beyond their borders. “The example of Swedish social democracy has inspired socialists across the continent, and in my country, too, in Spain,” he said.

In Sunday’s elections, voters gave the Social Democrats 28.4 percent of the vote nationwide—several points higher than the polls had suggested, but still their worst result in a century. With a long and complicated coalition-building process ahead, it’s unclear whether Löfven and his center-left coalition will be able to remain in power. Immigration and law-and-order issues took center stage in the Swedish campaign and the far-right Swedish Democrats capitalized, finishing with 17.6 percent. “We went down a few percentage points, less than expected, and the Sweden Democrats gained—also less than expected,” Johan Hassel, the Social Democrats’ international secretary, told me Monday morning. “But you still see that we are not isolated from the trend which is going through Western democracies.”

Since democracy came to Sweden, Löfven’s Social Democrats have dominated the country’s politics. With roots in the labor movement and an international reputation as the architects of Sweden’s celebrated social-welfare system, they have won the most votes in every election for the past century. That prolonged dominance and resonance beyond Sweden had party leaders on edge as they contemplated the possibility of losing their status as the biggest political force in Sweden: Where did we go wrong? What else could we have done to stanch the bleeding? they wondered.

The results here come amid a string of electoral losses for social-democratic parties across Europe. Aided by the rise of far-right populists, the traditional center-left has, in just the past year, been decimated at the polls in a number of countries, including Germany, Austria, and Italy. Out of 28 European Union countries, just six—Sweden, Malta, Romania, Slovakia, Spain, and Portugal—are still led by the center-left (though others, including Germany, have center-left parties as junior governing partners). There’s a sense that social democracy, once a movement with clearly defined aims, has lost its way in the post-2008 world.

Of course: The Social Democrats still remain by far the largest party after Sunday’s elections. The 28.4 percent they won would have been a dream for, say, Germany’s Social Democrats (who won 20.5 percent last September and have since fallen even further) or Italy’s Democratic Party (which fell out of government after dropping to 23 percent in March’s elections). But given the Swedish party’s history—in some elections, its taken more than 50 percent of the vote—it also has comparatively further to fall.

Here in social democracy’s heartland, the leaders of the Social Democrats seem well aware that they set the tone for similar parties across Europe. They’re thinking about how to change the direction of the movement, and considering the kind of vision the party should present going forward. Changes below the surface have also threatened to upend the center-left’s traditional bases of support: union members, once a key demographic for the Social Democrats, have in recent election cycles begun defecting to the far right. Sweden Democrats politicians say this is because the Social Democrats have lost credibility on the issues most important to voters. “The voters don’t trust these parties, and I understand … They’re un-trustable,” Markus Wiechel, a Sweden Democrats MP and the party’s foreign-policy spokesman, told me in the Swedish Parliament a few days before the vote. “They could say one thing one day and then something completely different the next day.”

Wiechel’s Sweden Democrats benefitted from the big shifts underway within the Swedish electorate: Exit polling Sunday night found a remarkable 41 percent of Swedish voters opted for a different party than they’d chosen in 2014. In other words, the trend lines have been worrying for the Social Democrats for a while—and, despite a generally strong economy, voters don’t seem to feel secure about their own fortunes and futures.

Along those lines, Löfven, the prime minister, told me while going door to door in Enköping last week that social democracy’s troubles can be traced back to the 2008 financial crisis and the government’s inability to make voters feel they were being taken care of. In a country like Sweden, known for its social-welfare system, this is undoubtedly a bigger deal than it would be elsewhere. “Workers were left alone, left on their own—the government at that time did not take responsibility, so this creates an uncertainty and a fear in a society,” he said. “That is why I’ve been so clear [that] what we need to do is to invest in our welfare, so that everybody understands, ‘I’m also part of this society.’”

While the Social Democrats made a convincing argument that they could strengthen Sweden’s welfare state, they also tacked right on immigration, backing a massive reduction in refugee arrivals until a European-wide solution materializes. That shift, some party leaders said, allowed them to regain (some) control of the political conversation from the anti-migrant Sweden Democrats, and shift it toward more traditional issues such as health care and welfare—friendlier terrain for the Social Democrats. “Voters demand an answer on migration, and when you deliver that, you have again an opportunity to talk about your issues,” Hassel said. “That is an answer we are going to share with other European social-democratic parties.”

Ultimately, the Social Democrats were handed somewhat of an electoral reprieve here. But their better-than-expected election night doesn’t mean questions about the big-picture future of the movement—both here and across the rest of Europe—will go away.

“In a way it’s also how societies are, they’re very shortsighted: It’s only this election period, these four years,” Anna Sundström, the secretary general of the Social Democrats–aligned Olof Palme International Center, told me ahead of the vote. “You sort of forget to talk about, what about in 20 years, or 50 years? We’ve not been maybe good enough at explaining where it is we want to go. Yes, we’ve created a fairly good society, but then what?”

We want to hear what you think about this article. Submit a letter to the editor or write to letters@theatlantic.com.