A historic win for the anti-immigrant party in the shining beacon of European values could seismically upend the continent's future, but establishment parties may still collude to keep the Sweden Democrats out of power – for now.

The campaign for Sunday's parliamentary vote ended as it had run – with dire warnings well outside normal political discourse from the incumbents, and indignation verging on self-proclaimed martyrdom from the upstarts.

Stefan Lofven, the Social Democrat prime minister, called voting for the Sweden Democrats "rooted in racism and Nazism," and "dangerous" for the nation. It was "like trying to quench fire with alcohol," he said.

Meanwhile, the party said that it would boycott national broadcaster SVT after it publicly interjected in the final televised political debate on Friday, taking time out to say it "does not stand" by views expressed by Sweden Democrats leader Jimmie Akesson. He had said earlier in the discussion that immigrants fail to find jobs in the country because "they are not Swedes" who "do not fit."

But the grandstanding and vitriol in a society reared on heated but civil disagreement is not just for show. The political fate of Sweden is genuinely up in the air.

Most polls give the center-left Social Democrats the narrowest of leads, but the country's historically dominant party is almost certain to achieve its worst election result since 1908, likely winning around a quarter of the votes. They could be pipped at the finish line by the Sweden Democrats, whose results in past elections have been underestimated by pollsters who failed to take into account shy voters. The traditional conservative opposition, the Moderate Party, is likely to be pushed into third place, but the difference between all three front-runners will probably be in single figures.

But as in Italy earlier this year, the results of the individual parties will only give a hint to the make-up of the future government.

"This is the first time in the history of Sweden that it's very difficult to say who is going to win, because the parties are trying to build different constellations of blocs," says Adrian Groglopo, professor of social science at the University of Gothenburg.

Both the center-left and the center-right coalitions are polling at around 40 percent, with the balance made up by the Sweden Democrats, with which both sides said they will not work (in turn, Akesson himself has also insisted that his party will not join any centrist grouping without considerable concessions). This leaves the option of a grand coalition, something that has never occurred in peacetime, or a particularly weak minority government.

Like in Italy, of course, where the Five Star Movement also promised to stay on its own, before pairing with Lega, a kindred party to the Sweden Democrats, the waning center-right could compromise rather than let the socialists rule for another term.

"The conservatives want to be back in power doubt very much that they are going to hold their promise not to form a coalition with the far-right," says Groglopo. "If this happens, we will have a whole other kind of Sweden."

'Nothing in Sweden is working as it should'

Throughout the campaign, however, the question of "the kind of Sweden" the electorate wants has not been a settled one, but the focus of intense soul-searching.

To international doomsayers (and Steve Bannon), the rise of the Sweden Democrats is about the nationalist rejection of the EU, and most of all about migration.

Sweden has welcomed 1.7 million foreigners since 2000, taking in more refugees per capita in the last four years than any other EU state, and nearly one-in-five residents was born outside the country.

Even the more tangible issues that have dominated the manifestos cannot be untangled from the influx. The rising level of violent crime has been attributed to migrant ghettos and foreign gangs, the falling performance of schools put down to having to accommodate so many non-native speakers, the housing crisis in major cities partly blamed on the fast-rising population, while healthcare and police are also stretched beyond intended capacity.

But the mood of the negative, reactive election race, in which even the centrist parties haven't dared to appropriate Barack Obama's "Hope" rhetoric, hasn't just been about the failure to adequately tackle a single issue, but a more pervasive sense of malaise and pessimism that has gripped the country – whether real or perceived.

"People feel Sweden is moving in the wrong direction. They are more punishing the government than they are voting for an alternative," says political scientist Stig-Bjorn Ljunggren.

Daniel Friberg, from the right-wing think-tank RightOn.net is even more blunt.

"The welfare state is collapsing, nothing works as it should. The voters see this but they can see that neither of the main centrist parties can address this problem," he tells RT.

In fact, the doubts are not about whether Sweden needs a course correction, but whether the very idea of the country as it is remains sustainable.

Throughout the last century, the country has prided itself first on its welfare state and democracy, then on its tolerance and welcoming attitude to migrants, then on its ability to combine economic success with its core social values.

This is a state that unironically labels itself a "humanitarian superpower," and sees itself as a moral example, particularly in the age of Donald Trump. But can you be a superpower if you cannot stop grenade attacks or mass car-burnings? And if Sweden can't solve this conundrum, which country on the continent can?

Both the insiders and the outsiders say they are custodians of the country's values. The socialists claim that it would be a betrayal of its values to drop its endlessly tolerant internationalism, while the right insists that a loss of social cohesion augurs a breakdown of everything that made Sweden more than a Scandinavian backwater.

Even when they lose, they win

And despite some attempts at triangulation – Akesson is stringent in expelling open racists from his party, while Lofven is a legendary tough talker on law and order – only one of these visions can be implemented after Sunday.

Ljunggren says the center will hold – like it did in 2014, when the Sweden Democrats backed an opposition budget, sparking the threat of a snap election, that was avoided when the two main parties struck a deal.

"The Sweden Democrats will be isolated for one more parliament," he says. "Maybe in the long run, when they have candidates who are not misbehaving, when they are more serious about their policies, they will gain more influence. But in the next few years they will be outsiders."

Friberg believes that establishment backroom stitch-ups will anger an already restive electorate, however, particularly if it looks like the supposedly right-wing parties "would prefer to support the continuing high level of immigration than to govern, simply to keep out the Sweden Democrats."

"If they go on and form a government with their traditional worst enemies to stop Akesson, the voters will punish them at the next election, and don't be surprised if the Sweden Democrats get 40 or 50 percent at the next election," he says.

Groglopo predicts that any coalition could be so volatile, and so vulnerable to acts of sabotage from whoever is left out that a new election could come as soon as January or February next year.

"Nothing is clear, yet one thing is certain. Swedish society is growing more and more divided, and Sweden Democrats are getting more and more power," he says.

Just how powerful, the rest of Europe will watch – Emmanuel Macron and Angela Merkel with trepidation, and Viktor Orban and Matteo Salvini with hope.

Igor Ogorodnev, RT

Subscribe to RT newsletter to get stories the mainstream media won’t tell you.