Stockholm: Sweden faces a political impasse after its mainstream centre-left and centre-right blocs virtually tied in an election on Sunday, while the far-right - which neither wants to deal with - made gains on a hardline anti-immigration platform.
With nearly all votes counted on Monday, the ruling centre-left Social Democrats and Greens and their Left Party parliamentary ally had 40.6 per cent of the vote, while the opposition centre-right Alliance was on 40.3 per cent.
That translates into a single-seat advantage in the 349-member Riksdag.
The Sweden Democrats, a party with white supremacist roots, won 17.6 pe rcent, about 5 percentage points more than four years ago.
It was the biggest gain of any party and in line with conventional opinion polls but fell short of the 20-30 per cent their leader Jimmie Akesson had predicted.
"Most signs pointed towards the Sweden Democrats taking over the position as the second-biggest party in Sweden. But the expected ... bang did not happen," the liberal Expressen daily said in an opinion piece.
"Sweden is now on steadier grounds than what we could have feared before the election."
Many online surveys, which in the last election had gauged the Sweden Democrats' vote better than conventional polls, had signalled they could dethrone the Social Democrats as the nation's biggest party - a position the centre-left has held for a century.
In the end, the Sweden Democrats were beaten by Prime Minister Stefan Lofven's Social Democrats by a 10 percentage point margin and eclipsed also by Ulf Kristersson's Moderates, the Alliance's candidate for the premiership.
"In some sense we're happy the Sweden Democrats didn't grow more than they did," Liberal Party lawmaker Allan Widman told Reuters.
"The bigger they become, the more hard pressed all other parties become."
The Sweden Democrats' success follows a rise in popularity of other far-right parties in Europe amid growing anxiety over national identity, the effects of globalisation and fears over immigration boosted by conflicts in the Middle East and Africa.
Sweden saw itself as a "humanitarian superpower" for years, but a rise in gang violence in immigrant-dominated, socially deprived city suburbs has also won support for the Sweden Democrats.
After the arrival of 163,000 asylum seekers in 2015 - the most in Europe in relation to the country's population of 10 million, the government suspended many of its liberal asylum policies.
There was a sense of relief among supporters of mainstream parties about the far-right's less dramatic gains.
That was shared in Brussels. "It is clear that the claim that the far-right is on an inexorable roll and will devour everything that stands in its way is false," said one EU official, while acknowledging that there is fragmentation among parties.
Still, the Swedish election underscored a broader shift to the right in one of Europe's most socially progressive nations.
Senior figures in the mainstream parties headed into meetings on Monday to produce a strategy for forming a government.
But the process could take weeks and possibly fail, with the Sweden Democrats vowing to sink any cabinet that doesn't give them a say in policy.
"We won't participate in letting through a government which doesn't give us influence," Akesson said on local channel TV4.
"On the contrary, we will do what we can to take down any such government."
Akesson hopes his party, which wants Sweden to leave the European Union and freeze immigration, can play a decisive role in negotiations over forming a government, a prospect so far rejected by all other parties.
He challenged Kristersson to choose between seeking support from the Sweden Democrats for an Alliance government or accept four more years of Lofven as prime minister.
Kristersson called on Lofven to resign, but also rebuffed Akesson.
"We have been completely clear during the whole election. The Alliance will not govern or discuss how to form a government with the Sweden Democrats," he said.
Both sides laid claim to being best placed to form a government, although votes from Swedes living abroad are not due to be declared until Wednesday and these could still sway the final outcome slightly.
Yet in the same breath, leaders of both sides called for bipartisan accommodation to avoid gridlock in parliament.
Sweden's centre-left and centre-right have ruled together only a handful of times since the mid-1930s.
Also, a 2014 accord to neutralise the Sweden Democrats and let the biggest bloc rule proved deeply unpopular among centre-right grassroot members and rapidly unravelled.
"Something has got to give," Umea University political scientist Magnus Blomgren said.
"Whether that's an agreement across the political divide in some way or not, something has to be done."
A new election will be called if parliament doesn't agree on a prime minister after four attempts.