Sweden faces a political impasse after its mainstream centre-left and centre-right blocs virtually tied in an election yesterday, while the far-right - which neither wants to deal with - made gains on a hardline anti-immigration platform.
With nearly all votes counted, the ruling centre-left Social Democrats and Greens and their Left Party parliamentary ally had 40.6% of the vote, while the opposition centre-right Alliance was on 40.3%.
That translates into a single-seat advantage in the 349-member Riksdag.
The Sweden Democrats, a party with white supremacist roots, won 17.6%, about five 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% 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 politician 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 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 does not give them a say in policy.
"We won't participate in letting through a government which doesn't give us influence," Mr Akesson said on local channel TV4.
"On the contrary, we will do what we can to take down any such government."
Mr 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 Mr Kristersson to choose between seeking support from the Sweden Democrats for an Alliance government or accept four more years of Mr Lofven as prime minister.
Mr Kristersson called on Mr Lofven to resign, but also rebuffed Mr 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.