Sweden is headed for a hung parliament after an election that saw the popularity of the far-right Sweden Democrats surge, as one of Europe's most liberal nations turns right amid fears over immigration.

Far-right parties have made spectacular gains throughout Europe in recent years amid growing anxiety over national identity and the effects of globalisation and immigration following armed conflict in the Middle East and North Africa.

In Sweden, an influx of 163,000 asylum seekers in 2015 - the most in Europe in relation to the country's population of 10 million - has polarised voters and fractured the political consensus.

Partial results, with some 80% of districts counted, showed the ruling centre-left Social Democrats and Greens and their Left Party parliamentary allies winning 40.6% of the vote, while the opposition centre-right Alliance were seen at 40.1%.

Social Democrats supporters
Supporters celebrate at the Social Democratic Party's election party in Stockholm this evening

The Sweden Democrats, a party founded by white supremacists, rose to 17.8% from 12.9% in the last election four years ago, in effect securing the balance of power.

Still, its result looked set to fall short of its own leaders' predictions of a vote of 20% or more.

Nevertheless, party leader Jimmie Akesson told a party rally: "We will gain huge influence over what happens in Sweden during the coming weeks, months and years."

With neither main political bloc able to command a majority, the Sweden Democrats, who want the country to leave the European Union and put a freeze on immigration, could play a decisive role in negotiations over forming a government that look set to be complex and drawn-out.

Mr Akesson challenged Ulf Kristersson, the centre-right Alliance's candidate for the premiership, to choose between seeking support from the Sweden Democrats and the incumbent Social Democrat prime minister, Stefan Lofven (below).

Stefan Lofven

The election will add to concerns in Brussels as the European Union enters campaign mode ahead of the European Parliament election next May, which could give more voice to eurosceptic groups and thwart efforts at closer EU integration.

The record levels of asylum seekers in 2015 magnified worries about a welfare system that many voters already believe is in crisis, even though refugee numbers have fallen sharply since then.

Lengthening queues for critical operations, shortages of doctors and teachers and the failures of police to deal with inner-city gang violence have shaken faith in the 'Swedish model', built on a promise of comprehensive welfare and social inclusion.

We need your consent to load this rte-player contentWe use rte-player to manage extra content that can set cookies on your device and collect data about your activity. Please review their details and accept them to load the content.Manage Preferences

Mr Akesson had labelled the vote a choice between immigration and welfare in a campaign that was unusually antagonistic.

Mainstream politicians have so far ruled out cooperation with the Sweden Democrats.

But centre-left and centre-right parties face an uphill battle in trying to form a viable coalition government, following decades of acrimony between the two blocs that have defined Swedish politics for decades.

The Sweden Democrats have promised to sink any government that refuses to give them a say in policy, particularly on immigration.