Sweden's ruling center-left bloc commanded a marginal lead over the center-right Alliance in Sunday's national election with the unaligned, anti-immigration Sweden Democrats (SD) making gains, preliminary election authority results showed on Sunday.
The results after 4,800 of 6,004 districts had been counted, showed the the Prime Minister Stefan Lofven's Social Democrat and Green party coalition, together with the Left Party, winning 40.6 percent of votes, the election authority data showed.
The Alliance opposition bloc, composed of the Moderates, the Christian Democrats, the Centre party and the Liberals, looked set to win 40.1 percent.
Swedish centre-right opposition leader Ulf Kristersson called on Lofven to step down on Sunday after preliminary election results showed his opposition Alliance coalition in a virtual dead heat with its center-left rivals.
"This government has run its course," Kristersson told a party rally, referring to Lofven's minority cabinet. "Now it should resign."
The nationalist SD, anti-immigration nationalists that have been shunned by all other parties, were on track to get 17.8 percent of seats.
The results are partial and may differ slightly from the final outcome.
Marine Le Pen of France's far-right Front National nonetheless hailed SD's projected rise, tweeting: "Yet another bad night ahead for the European Union. The democratic revolution in Europe is moving forward!"
"Sweden, birthplace of multiculturalism and model for the left, has finally decided to change after years of wild, uncontrolled immigration," Italian Deputy Premier and Interior Minister Matteo Salvini, leader of the far-right League, said in a statement Sunday night.
Lofven has called the election a "referendum on the future of the welfare state" but the far-right SD have presented it as a vote on immigrants and their integration, after Sweden took in almost 400,000 asylum-seekers since 2012.
SD, with roots in the neo-Nazi movement, has said the arrival of asylum-seekers is a threat to Swedish culture and claims they put a strain on the country's generous welfare state.
"Everything suggests we're going to have a good election," SD leader Jimmie Akesson told news agency TT after voting in Stockholm.
"I've said throughout the campaign that 20 to 30 percent (of votes) is a reasonable score for us and I think that's possible."
Meanwhile, Lofven urged Swedes not to vote for what he called a "racist party" as he cast his ballot.
"It's... about decency, about a decent democracy. And the Social Democrats and a Social Democratic-led government is a guarantee for not letting the Sweden Democrats extremist party, racist party, get any influence in the government."
The Social Democrats, traditionally the biggest party and who have led a minority government with the Greens, have lost support on both the left and the right and are tipped to post their lowest score since 1911.
Anna Berglund, a 28-year-old lawyer who voted for the small Centre Party at a polling station in Stockholm's upmarket Ostermalm neighborhood, said SD's mounting support was "bad news."
"I'm afraid we're becoming a society that is more hostile to foreigners."
According to the government authority Statistics Sweden's latest figures, 18.5 percent of the total population was born abroad.
In Rinkeby, a disadvantaged suburb north of Stockholm home to a large immigrant population, locals were also concerned.
"I don't want SD. So I go see people and ask them if they have Swedish citizenship and if they do I tell them that it's important to go vote," Sofie, a Turkish woman in her 50s told AFP.
The head of the four-party Alliance (the conservative Moderates, Centre, Liberals and Christian Democrats), Ulf Kristersson, has also expressed concern over SD's rise.
"I have tried to prove to voters during the election campaign that if you really want a change, you have to vote... for our four parties. We are the guarantee to oust the current government from power," he said.
Well aware that neither Lofven's "red-green" bloc nor his own Alliance had a chance of winning a majority, Kristersson has said Sweden needs "a strong cross-bloc cooperation to isolate the forces... pushing for Sweden to withdraw from international cooperation."
While the final election results were due late Sunday, the composition of the next government may not be known for weeks.
Lengthy negotiations will be needed to build a majority, or at least a minority that won't be toppled by the opposite side.
The opposition is intent on ousting Lofven, with some Moderates willing to go so far as to put an end to SD's pariah status and open negotiations with them.
That could prove fatal for the Alliance, with the Liberal and Centre parties repeatedly ruling out a deal with "the devil", as Akesson occasionally calls himself.
A self-proclaimed nationalist, Akesson argues that multi-cultural values and customs prevent immigrants from assimilating into Swedish society.
"If you get the chance to move here then you should to try to live like us," Therese, an SD voter in Stockholm, told AFP.
"You should of course be allowed to have your own tradition and religion but keep it personal and within the family," she added.
None of the seven parties have been willing to negotiate with SD.
"I'm not an SD supporter, but it's a problem for democracy if the other party leaders refuse to talk to a party that represents the views of so many people," Josefine, a voter in Stockholm said.
In an interview with AFP during the campaign, Akesson stressed he would "lay down his terms" after the election, citing immigration policy, crime-fighting and health care as priorities.
Polling stations were due to close at 8 p.m., with final results due before midnight (2200 GMT).