Neither the ruling centre-left nor the centre-right blocs won a majority in Sweden’s elections on Sunday. The far-right Sweden Democrats, however, won big gains, becoming the country’s third-largest party.

Opinion polls before the elections had suggested the right party would fare well, as voters are unhappy about immigration laws. Sweden’s is one of Europe’s few remaining left-wing governments and the country has taken in hundreds of thousands of asylum seekers since its last election.

The ruling Social Democratic Party won the biggest share of votes, at 28.4%, led by the Moderate Party, which secured 19.8% of the votes, and the Sweden Democrats with 17.6%. The voter turnout was 84.4%.

Analysts have said the ruling party and second largest party, The Moderates, are unlikely to support each other. Prime Minister Stefan Lofven said he intended to remain in the post though, AP reported. Moderates leader Ulf Kristersson has called on Lofven to resign. However, Lofven has said they will “organise themselves”.

“We have a moral responsibility,” AP quoted the prime minister as saying. “We must gather all good forces. We won’t mourn, we will organise ourselves.” He said the results presented “a situation that all responsible parties must deal with”, but said “a party with roots in Nazism” would “never ever offer anything responsible, but hatred”. Both his left-leaning bloc and the centre-right bloc led by The Moderates have said they will not ally with the Social Democrats.

The tally

The bloc led by Prime Minister Lofven’s party won 40.6% of votes, or 144 seats, while the Moderates’ bloc has 40% of votes, or 143 seats. The majority mark in the 349-seat parliament is 175 seats. The Sweden Democrats have currently not tied up with any party. The numbers are based on 99% of the vote, CNN reported. Overseas votes will be counted on Wednesday.

Immigration to Sweden and the rise of a nationalist party

According to various reports, Sweden has taken between 400,000 and 600,000 asylum seekers since 2012. The country of 10 million took in a record 163,000 refugees in 2015 alone, according to AP.

The Social Democrats played on this in the run-up to the elections. The day before voting, Social Democrats leader Jimmie Akesson claimed the prime minister was prioritising the needs of new immigrants over those of Swedish citizens. The party, with roots in the neo-Nazi movement, called the arrival of immigrants to Sweden a threat to the country’s culture, European news network The Local reported.

Among their poll promises was a vow to end dual nationality for non-Nordic citizens. The party also repeatedly called for a “Swexit” referendum on the country leaving the European Union.

Rising support for the party has mimicked the drift in other European nations, where mass migration in the continent increased during the height of the Syrian civil war in 2015. Since then anti-immigrant parties have made gains in Austria, Britain, Denmark, France, Germany, Hungary and Italy.

Far-right leaders in Europe have praised the Social Democrats’ success in the polls.