Sweden has become the latest country in Europe to face a far right insurgency at the polls. The Sweden Democrats, a party with neo-Nazi roots, won 17.6 percent of the vote in the 9 September general elections, making them the third largest party in the Swedish parliament.

That a far right party could have such success in a place like Sweden is particularly shocking to many people. Scandinavian style social democracy is looked to as a model by a new generation of democratic socialists, and Bernie Sanders has spoken of his admiration for the country. With Nazis now in the parliament and the once dominant centre-left Social Democrats receiving their worst vote in more than 100 years, that model is in crisis.

The global far right are gleeful. For them, Sweden has also become a point of reference, cited as an example of the supposed failure of immigration. Cherry-picked crime statistics are used to portray Sweden as a violent dystopia by Breitbart media and other right wing outlets.

The Islamophobic former UKIP leader Nigel Farage is crowing about the latest election results, claiming them as part of an inevitable populist backlash against immigration.

The reality is that the rise of the far right follows decades of harsh neoliberalism and intensified mainstream racism.

These political developments, very similar to those happening across Europe, point to the contradictions which the Swedish model of social democracy has been unable to resolve.

The idea that Sweden represents an alternative – even socialist – model rests largely upon the expansive welfare state won by the labour movement there in the mid-20th century. Significant victories were achieved: guaranteed free housing, free universal health care, free university tuition, universal child care, state pensions and paid parental leave.

These gains rested on both the strength of the Swedish labour movement and the particular position of Sweden in global capitalism.

As Sweden industrialised in the late 19th and early 20th century, a powerful and centralised union movement developed. In 1909 a month-long general strike involved 300,000 workers under the leadership of the Swedish Trade Union Confederation. The strike was defeated, but over the coming decades, working class militancy remained among the highest in the world.

In 1931, striking timber and pulp workers in the town of Ådalen were fired on by the army. Five people were killed. The following day a general strike spread through Swedish cities, with 80,000 people in Stockholm protesting the killings.

This was the background to the victory of the Social Democrats (SAP) in the 1932 election. The party would remain in government from 1932 to 1976.

In 1938 the SAP oversaw a compromise that restricted trade union militancy in exchange for material concessions to the working class. These concessions depended upon the high profits Swedish capitalists were making from exports.

Sweden’s location in northern Europe has historically enabled it to benefit from trade with major capitalist economies as well as to maintain a degree of economic and political independence.

For example, Sweden formally remained neutral during World War 2, but maintained economic cooperation with Nazi Germany. It experienced an economic boom based in large part on supplying Nazi war industry with iron ore.

Sweden’s neutrality meant its infrastructure survived the war. After 1945, this enabled the economic boom to continue as Sweden benefited from selling supplies for the reconstruction of Europe under the Marshall Plan.

This boom gave space for concessions in the form of higher wages and the famous welfare state. While struggle by workers was important in winning them, they were also part of a plan for capitalist development on the part of the Swedish ruling class.

The economic policies of these years, outlined in the Rehn-Meidner model in 1951, were intended to produce a more efficient capitalism. Through a system of centralised bargaining, inefficient capitalists were driven out of business through wage increases, while high-productivity capitalists were rewarded with restrained wages and higher profits. State funding for education and welfare supported the transition of workers from failing to profitable businesses.

This model, alongside high income taxes, resulted in a higher than average degree of income equality between the working and middle classes.

It did not, however, challenge the inequality between capitalists and workers. Rather, it increased the concentration and centralisation of capital. In the 1970s, during the height of the Swedish welfare state, one family, the Wallenbergs, employed nearly 40 percent of Sweden’s industrial workforce.

This unchallenged power of capital proved a fatal weakness of the social democratic system.

When profitability fell, Swedish capitalists turned against the welfare state. By the 1990s, this had become a full-throttled neoliberal assault involving a wave of privatisations, cuts to welfare and slashing of company tax rates. Many of these attacks were implemented by the SAP, which had during the preceding few decades embraced neoliberalism.

The result is that Sweden today is a world leader in outsourcing public services to the private sector. Nearly a third of Swedish secondary schools are run by private organisations but funded by the public. Swedish students have dropped from among the best educated in the world to below the OECD average in maths, science and reading skills.

Inequality in Sweden has risen the fastest of any OECD country over the last couple of decades, largely because of these attacks.

It is in this context that support for the mainstream parties has fallen. Both the SAP and the main centre-right party, the Moderates, are seen to have embraced nearly identical neoliberal programs, and in the recent election both parties’ votes fell. Some of that vote went to the Left Party, but the big winner has been the far-right Sweden Democrats (SD).

The SD first emerged in 1988 out of the neo-Nazi “Keep Sweden Swedish” movement. The movement brought together Nazi relics of the 1930s with a younger generation of street thugs under the slogans of ending immigration and deporting those considered “non-Swedish”.

In the late 1990s the SD banned the fascist uniforms, toned down their overt anti-Semitism and adopted more mainstream Islamophobia as part of an effort to break into the electorate.

They have been helped by the increasing racism of the mainstream parties in relation to refugee rights and immigration. The idea that Sweden has taken in too many migrants, once the slogan of neo-Nazi street marches, is now the policy of the centre-left SAP. As the current SD leader, Jimmie Åkesson, told supporters in 2016, “Essential parts of our immigration policy are now being put in place by the Social Democratic government”.

The SAP claim this is necessary because of the supposed strain immigration is putting on social services. This has given legitimacy to the SD’s positioning as the only party hard enough on immigration to stand up for the welfare system, despite the party’s right-wing and neoliberal positions in support of tax cuts, welfare cuts and privatisation.

The accepted counterposition between immigration and the welfare state is false. The strain on the welfare system is the result of cuts demanded by the capitalist class in order to boost profits.

These profits have always ruled in social democratic Sweden. Reforms were winnable under favourable economic conditions and when they lined up with the interests of Swedish capitalism. When the economic situation inevitably changed, the capitalists clawed back profits at the expense of workers. The bitter fruit of this is being felt in Sweden today.