Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today’s WorldView newsletter.

Though a tricky game of coalition formation awaits, Spain’s center-left Socialists are right to be celebrating. They were the biggest winners in the country’s snap general election Sunday, claiming about 30 percent of the vote and a projected 123 seats in Spain’s 350-seat parliament — a marked increase from the 85 seats they held before in a minority government.

On the other hand, their chief opponents, the center-right People’s Party, suffered the worst electoral result in the party’s history, winning just a bit more than half the seat total of their rival Socialists. In power until it was brought down by a corruption scandal and a parliamentary no-confidence vote in 2018, the PP hemorrhaged support to parties on both its flanks. That included Vox, a far-right party that will enter Spanish parliament for the first time with 24 seats.

Vox’s emergence ahead of the election — and the prospect of its joining a ruling coalition alongside the center right — appeared to galvanize support for Socialist leader and incumbent Prime Minister Pedro Sánchez. He promised to push back against ultranationalist politics in a country that still lives with the memory and traumas of decades of fascist dictatorship.

“The future has won, and the past has lost,” Sánchez declared before cheering supporters on Sunday at the Socialist Workers’ Party headquarters in Madrid. “We’ve sent the world a message: We can beat the reactionaries and the authoritarians.”

The Socialists’ victory in Spain does indeed send a message. For the past couple of years, we’ve grown accustomed to talking about the steady demise of center-left parties in the West. In Europe, in particular, social-democratic factions that were once traditional mainstays in their nations’ politics faced debilitating, if not fatal, setbacks. From France to the Netherlands, Germany to Italy, center-left parties are now shadows of what they once were. Their connection to an entrenched liberal status quo — and therefore the aftershocks of globalization and the financial crisis — led to voter disenchantment. Then, a host of upstart far-right, anti-immigration, anti-establishment, populist parties ate into the working-class support that had formed the bedrock of social-democratic political power.

But Sánchez and his Socialists have been able to draw a line in the sand. He championed a robust social agenda, which included a 22 percent hike to the minimum wage in Spain, and probably wooed back voters who in previous elections backed parties further to the left. “Compared to the rest of Europe, Spain now appears a bastion of social democracy, and a defender of pro-European and progressive politics,” wrote José Ignacio Torreblanca, the head of the Madrid office of the European Council on Foreign Relations.

And Spain may not be so alone, either. “European socialists will see in Spain more evidence of the recovery of social democracy after the existential crisis of the austerity years. Sweden’s Social Democrats hung on to power last year while the center-left won Finland’s election, just earlier this month,” noted the Financial Times. “Italy’s Democratic party is also staging something of a comeback while Portugal’s socialists look destined to win re-election later this year.” Local elections later this week in Britain may also add to the political momentum of Labour and the Liberal Democrats there.

Analysts even gestured at an emerging potential bulwark of parties in Europe that remain doggedly pro-Brussels and in favor of more inclusive politics across the continent. “The good news for the European Union, particularly in the midst of Brexit, is that Spain now has a reinforced socialist leader who can help draw a clear axis across the Continent — running from Lisbon through Madrid and Paris to Berlin — of governments committed to more European integration,” Pablo Simón, a professor of politics at University Carlos III in Madrid, told the New York Times.

But he added that what works in Spain may not translate so readily elsewhere. “The flip side is that the election has shown the exceptionalism of the Iberian Peninsula, where the socialists can still mobilize voters much more effectively than in other countries,” Simón said.

The results from Spain were also as much about the frailties of the center right as the solidity of the center left. The PP vote was cannibalized by Vox and the Citizens, a moderate libertarian party that chose to run on a more stridently nationalist platform. The center-right party’s woes echoed those of Les Republicains in France or Forza Italia in Italy, factions that both now play second fiddle to far-right parties in their countries. “Traditional European center-right parties are now in only marginally better shape than their social-democratic counterparts, but their decline has received much less attention,” wrote Stan Veuger of the conservative American Enterprise Institute, pointing also to the diminished mandate a continental center-right bloc may win in European parliamentary elections next month.

Cas Mudde, an expert on European politics at the University of Georgia, told Today’s WorldView that while the PP’s plight was in some sense unique — it was enfeebled by a particularly damaging graft probe that sent some of its lawmakers to prison — it fell into the trap that has already undermined center-right parties elsewhere in Europe. “Pivoting to the right, particularly on immigration and Islam, but also on other nationalist issues, will not save discredited mainstream right parties from losing significantly to the far right,” he said.

At the same time, Mudde said, the Socialists’ win shows that “social democratic parties can still can be successful as openly social democratic parties in power,” without having to turn to anti-immigrant politics or equivocate with parties further to the right. What’s crucial, Mudde added, was Sánchez’s ability to focus his political pitch on socioeconomic issues, including inequality, rather than the siren song of identity inflaming politics elsewhere in the West.

That may get trickier as he and his party attempt to chart a path toward a stable ruling coalition in Spain’s fragmented political landscape. As of now, an alliance with the Citizens, the most likely partner on the right, has been ruled out of the question. So the Socialists, along with other parties on the left, may have to ally with a Catalan regional party that favors secession from Madrid — a cause that helped spur the rise of the angry nationalists in Vox. A similarly fragmented vote in next month’s European elections could mean Sánchez has a very short honeymoon period.

“The country has endured an excessive amount of instability,” La Vanguardia newspaper said in an editorial Monday. “That is never good. And it’s even worse when the European Union has the same problem, due to Brexit and the rise of populism.”

Want smart analysis of the most important news in your inbox every weekday along with other global reads, interesting ideas and opinions to know? Sign up for the Today’s WorldView newsletter.