Foreign observers covering the Swedish elections of September 9 tend to focus on the rise of the immigration-critical Sweden Democrats. It is a story that most often is linked to broader trends involving globalization and migration, drawing a picture that pits liberal-minded globalists against xenophobic nationalists. But the rise of a right-wing populist party in Sweden is particularly stunning. Sweden has for a long time imagined itself and been portrayed by others as a “moral superpower,” devoted to its welfare state at home and to global solidarity and human rights abroad.

During the refugee crisis in the fall of 2015 Sweden also—at least initially—stood out as the most open and welcoming country in the European Union. On September 6 of that year, The Social Democratic prime minister, Stefan Löfvén, declared that “my Europe does not build walls.” Yet Löfvén and his Green Party allies would soon have to back down, and at a tearful press conference on November 24, the government was forced to reverse course in the face of chaotic conditions and increasing popular resistance, expressed not least in rising support for the Sweden Democrats. By January 2016 the borders were effectively closed.

Yet the political damage was already done. In fact, the Social Democrats have been losing ground since 1968, when they received over 50 percent of the vote, and support for the Sweden Democrats, who entered Parliament in 2010, grew considerably with the 2014 elections. But this year’s election, with the Sweden Democrats winning 17.5 percent of the vote—their highest ever, though not as high as many preelection estimates had predicted—and the Social Democrats winning only just over 28 percent—their worst result in over 100 years—has prompted many observers to announce the end of the famed Swedish model, or at least the normalization of Sweden, turning it into a country like any other.

So how are we to understand this turn of events? The economy is very strong, and unemployment is low. And while xenophobia and even racism exist in Sweden, like it does everywhere, there is little evidence that these sentiments are particularly strong here. Indeed, data from both national surveys and comparative ones, like Pew, suggest that national identity in Sweden to an unusual degree is linked more to civic notions such as citizenship and rule of law than to ethnicity and the rule of blood.

A useful point of departure is to ask what made the Social Democrats so successful to begin with, allowing them to dominate Swedish politics since the 1930s, arguably making them the most successful social-democratic party in the world.

Central to this success has been the ability of the Swedish Social Democrats to dominate what we can call the politics of national community. Historically speaking this was by no means a given. During the 1920s and ’30s, struggles took place throughout Europe over who would write the national narrative and thus be able to tap into the potent power of nationalism. In general, it was right-wing parties that won out, offering up visions of national community that were cast in the language of xenophobia and ethnic solidarity.

The political left, on the other hand, had an anxiety-ridden relationship with the idea of the nation, national solidarity, and nationalism that dated back to Marx and the old ideals of the international and the notion that workers have no fatherland. In most countries, the parties of the left were hampered by their attachment to an internationalism that was linked to a Marxian conviction that both the nation and the state were destined for the dustbin of history. Their preferred mode of political rhetoric was instead one that emphasized a global class struggle in which they joined hands across national borders under the banner of the red flag. This left them open to attack from parties to the right, which accused them of being unpatriotic and lacking a sense of national solidarity.

The hopes that socialist internationalism would overcome supposedly backward allegiances to nation and state were largely buried in the spirit of 1914. In the trenches of World War I German and French workers abandoned the red flag in favor of their national banners. But unease with the nation remained in many leftist and social-democratic parties. The Social Democrats in Sweden and the other Nordic countries were in this regard exceptionally successful in bucking the general trend that favored the victory of right-wing nationalism. By fusing nationalist and socialist ideals they laid, during the 1920s and ’30s, the groundwork for the social-democratic welfare state.

They gradually abandoned the divisive language of class and class struggle in favor of the language of “folk” that served to create political bridges to both the rural peasantry and the urban middle classes. By 1933, the year that Hitler came to power in Germany under the banner of Volksgemeinschaft (“people’s community”), the Swedish Social Democrats had already formed the first of many governments in the name of folkhemmet (“the people’s home”). Both slogans celebrated national community, solidarity, and welfare, but while in the German case the ideal was ethnos, seeking ethnic purity under authoritarian leadership, the stress in the Swedish was on demos, connoting social equality, individual freedom, and democracy. A national narrative was established that cast the Swedes as intrinsically democratic and freedom loving, as having democracy in the blood. Thus, since to be a Swedish nationalist meant perforce that one embraced democratic values, it was possible in the 1930s for the Social Democrats to successfully harness the power of national feeling, to become democratic nationalists and fight off the challenge from domestic right-wing nationalists in the Nazi mold.

By abandoning the rhetoric of class struggle, they also placed themselves in a position to build ties with the Swedish industrial elite, finding legendary expression in the so-called Saltsjöbaden agreements of 1938 that set in place a corporatist order of peaceful and constructive relations between labor unions and big business, crucial to the construction of the welfare state.

In their national turn, the Social Democrats managed to fuse notions of individual freedom, social equality, and national community, harking back to the slogan of the French Revolution (liberty, equality, fraternity), but also looking forward by embracing modern notions that stressed individual autonomy and gender equality. In this way, the “Swedish model” came to be characterized by an extreme form of statism even as it involved a rejection of traditional socialist goals such as the nationalization of banks and industries. Instead, it opened up a new arena for radical social transformation, particularly in the realm of family and social policy, organized around a social contract between a strong and good state, on the one hand, and the emancipated and autonomous individual, on the other, in what I have called “statist individualism.”

The focus was on creating social mobility and equal opportunity, and to replace the need for philanthropy and charity with taxes and social rights. At heart was an emancipatory logic that connected citizenship, work, and taxes to social rights. This moral and political logic found institutional expression in the modern Swedish welfare state, which was founded on a political vision whose fundament was social trust, confidence in common institutions, and a radical form of individualism for all, enabling a strong emphasis on gender equality, children’s rights, and the autonomy of the elderly. It was a social contract that embraced a civic universalism within the nation-state where the individual citizen was the base unit.

This social order still has strong popular support; hardly any political party is opposing it. Still, since the fall of the Berlin Wall, its basis—the nation-state, individualism, and universal citizenship—has come to be undermined.

On the one hand, the nation-state and nationalism have been swept up in a perfect storm, subjected to trenchant criticism from an unholy alliance of the left and the right. The state has been the chief target of the neoliberal right, which has championed lower taxes and less regulation in the name of the global market society. And the nation has become the bête noire for the no-borders and human-rights left, for whom the idea of the nation has been linked to xenophobia and racism; the new ideal has become a global and multicultural civil society.

On the other hand, the universal and individual-based idea of citizenship has in recent decades been challenged by those on the left who favor identity politics. Not satisfied with anti-discrimination and equal rights for all citizens, this new left appears to be betting that they can win elections chiefly based on support from women and sexual, ethnic, and religious minorities. The old heroes of the workers’ movement, many of them white, heterosexual males, have been demoted in favor of a new rainbow coalition, Swedish style. Influenced by US trends, this left tends to speak in the language of “heteronormativity,” “patriarchal structures,” and “whiteness norms.” To some, it even appears as if “human rights” has become not only a code word for post-national visions of open borders and diversity, but also a concept in which the notion of the equal value of all humans tends to exclude historically culpable white, heterosexual men.

These political currents have posed problems for the Social Democrats, for whom the nation-state has historically been the primary tool for balancing the market with a politics of citizenship and social investment. The Social Democrats now struggle to find a convincing balance between their traditional commitment to nation-state and universal citizenship while also appealing to the more recent rhetoric celebrating post-national visions, multiculturalism, and human rights.

The current left’s one-dimensional and negative view of nationalism and the nation-state has created a political vacuum into which the Sweden Democrats have moved, celebrating both the Swedish nation and the male, white working class, successfully attracting many formerly Social Democratic union members. The big, postelection question now is to what extent the Social Democrats can find a way to reconstitute a broader alliance of citizens, without alienating minorities, and to reaffirm its embrace of the nation-state, without abandoning its commitment to international solidarity.

Conversely, the Sweden Democrats face the opposite dilemma. Since both the Social Democrats and the center-right Moderates now have agreed that immigration must be limited and regulated, it may well be that this issue will become less salient in the future. Thus, they have to face the question of how they can continue to grow, given clear limits in Sweden to ethnic nationalism as well as to the conservative social values they espouse, which are hostile to the radical individualism, gender equality, and antidiscrimination that has firm and wide support in the Swedish electorate, even among those who are critical of open-borders policies.