But while there was a sense of relief among supporters of mainstream parties about the nationalist group's more limited than expected gains, the election underscored a broader shift to the right in one of Europe's most socially progressive nations.
The prime minister is usually the leader of the party with the most votes, but Sweden's fragmented political landscape after Sunday's vote makes it impossible to predict who will build the next government, a process likely to take weeks.
With nearly all the votes counted, the centre-left coalition made up of the Social Democrats and Greens and the Left Party had 40.6% of the voted.
The party also wants to hold a referendum on Sweden's European Union membership along the lines of the Brexit vote in the U.K. Despite a clear victory, Sweden Democrats seem to have gained less than one-fifth of votes and remain the third-largest party.
"However the dramatic bloc battle plays out, it looks like it will be hard for Sweden to have a functioning government", paper of reference Dagens Nyheter wrote in an editorial. "No one can take that away from us", he said, according to The Guardian.
The Social Democrats won 28.4% of votes, down 2.8 points from the 2014 elections, their worst score in a century.
Currently, Social Democrats leader and Prime Minister Stefan Lofven have a minuscule two-mandate lead over the centre-right opposition, with 144 seats against 142.
Acknowledging the parliamentary deadlock, he extended an invitation to the opposition. He has done a great deal to sanitise the party, kicking out radical members, he now believes the main parties need to look to them and do work with them.
That raised questions whether the parties might find a way for the far-right party to vote with the Moderates at least part of the time and helping to install a center-right leader in the prime minister's office.
"This government has had its chance".
The Alliance was meeting Monday to hammer out a plan of its own.
About 6300 candidates sought the four-year terms. The leader of the Moderates party that came in second, Ulf Kristersson, already had called on Lofven to resign and claimed the right to form Sweden's next government. Past year in October, almost seven months after the March election, prime minister Mark Rutte pulled together a shaky coalition of four parties on a centre-right programme.
They are ready to block any attempt to pass legislation, such as the autumn budget bill.
Mr. Lofven could also invite the Centre and Liberal parties to join him at the negotiating table.
Despite their differences, notably on immigration policy, the Alliance parties that ruled Sweden from 2006 to 2014 have agreed to try to form a government together.
But that is no easy task, and the Alliance would still need the far-right's support to obtain a majority.
The Sweden Democrats emerged with 63 MPs, up from 49, leaving them in a strong position.
If the Sweden Democrats were included in the conservative bloc, there would be a large conservative majority in this election. "What will happen to me if they enter government or gain influence", asked Mohammad, an 18-year-old Afghan refugee who spoke ideal Swedish when interviewed by AFP.
"Even there... they are saying no to this Europe of bureaucrats and speculators, no to illegal immigrants, no to Islamic extremism".
But, he told news agency TT, "we have a long list of demands we're going to set in any negotiations".
The party, rooted in a neo-Nazi movement, has worked to soften its image and has played a role in breaking down longstanding taboos on what Swedes could say openly about immigration and integration without being shunned as racists.
Mattias, a Stockholm resident at an election night party in the city, said he was "extremely concerned" about the far right's steady climb. "Things will just stop". Sam Andersson, a carpenter, told AFP he feared a situation like that in Belgium which went 589 days without a government in 2010-2011.