By Simon Johnson and Johan Ahlander
STOCKHOLM (Reuters) - Swedes voted on Sunday in an election dominated by fears over asylum seekers and welfare, with the anti-immigration Sweden Democrats vying to become the biggest party in a country long seen as a bastion of liberal values.
Far-right parties have made spectacular gains throughout Europe in recent years after a refugee crisis sparked by civil war in Syria and conflicts in Afghanistan and parts of Africa.
In Sweden, the influx of 163,000 asylum seekers in 2015 has polarised voters, fracturing the political consensus and could give the Sweden Democrats, a party with roots in the white supremacist fringe, a veto over who forms the next government.
"Traditional parties have failed to respond to the sense of discontent that exists," said Magnus Blomgren, a social scientist at Umea University.
"That discontent maybe isn't directly related to unemployment or the economy, but simply a loss of faith in the political system. Sweden isn't alone in this."
The centre-left bloc, uniting the minority governing Social Democrat and Green parties with the Left Party, is backed by about 40 percent of voters, recent opinion polls indicate, with a slim lead over the centre-right Alliance bloc.
The Sweden Democrats, who want the country to leave the European Union and put a freeze on immigration, have about 17 percent, up from the 13 percent they scored in the 2014 vote, opinion polls suggest.
"Throughout the whole election campaign I have said that somewhere between 20 and 30 percent is a reasonable election result for us and I think it is possible," Sweden Democrats leader Jimmie Akesson told reporters on Sunday.
The party's support was widely underestimated before the previous election and some online surveys give them as much as 25 percent, a result that would be likely to make them the biggest party, dethroning the Social Democrats for the first time in a century.
"It would send a big 'go to hell' message to me and my kind," said Stefan Jovanovic, 26, a music business manager with roots in Serbia.
"Because we all know that their whole political message is about one thing and one thing only, and that is the question of immigration."
Such an outcome could weaken the Swedish crown in the short term, but analysts do not see any long-term effect on markets from the election because economic growth is strong, government coffers are well stocked and there is broad agreement about the thrust of economic policy.
GRAPHIC - Swedish general election opinion polls: https://tmsnrt.rs/2LmSZFD
Sweden has flirted with populism before. New Democracy, founded by an aristocrat and a record producer, won nearly 7 percent of the vote in 1991, on the promise of strict immigration policies, cheaper alcohol and free parking, only to crash out of parliament three years later.
The Sweden Democrats are bidding to become the biggest populist party in the Nordic region, topping the Danish People's Party, which gained 21 percent in 2015, and trump the 12.6 percent for the far-right Alternative for Germany, which swept into the Bundestag last year.
With an eye on the European Parliament elections next year, Brussels policymakers are watching the Swedish vote closely, concerned that a nation with impeccable democratic credentials could add to the growing chorus of euroscepticism in the EU.
Sweden took in more asylum seekers per capita than any other country in Europe in 2015, magnifying worries about a welfare system that many voters already believe is in crisis.
Lengthening queues for critical operations, shortages of doctors and teachers and a police service that has failed to deal with inner-city gang violence have shaken faith in the "Swedish model", built on a promise of comprehensive welfare and social inclusion.
The Sweden Democrat's Akesson has labelled the vote a choice between immigration and welfare in election campaign that has been unusually antagonistic.
"It has been really unpleasant," student Katze Collmar, 32, said while voting in central Stockholm.
"It feels like Sweden could take a step in this election that we won't be able to recover from very easily."
Mainstream politicians have so far refused to cooperate with the Sweden Democrats.
But with some kind of cooperation between parties in the centre-left and centre-right blocs an equally unlikely alternative to the current political deadlock, analysts believe that Akesson may yet end up with some influence on policy.
"I have a good feeling about tonight," said Per Ramhorn, a Sweden Democrat lawmaker on his way in to his party's election rally in the capital.
"The other parties have kept us at arms length, but I think they will be prepared cooperate when they see the outcome."
The Sweden Democrats have promised to sink any government that refuses to give the party a say in policy, particularly on immigration.
With deadlock looming, it could take weeks to form a government.
Voting stations close at 1800 GMT, with exit polls set be published by Sweden's two main broadcasters. Results from the vote will become clear later in the evening.
GRAPHIC - Sweden economy overview: http://tmsnrt.rs/2bylYpf
(Additional reporting by Johan Sennero, Anna Ringstrom and Reuters TV; Writing by Simon Johnson and Niklas Pollard; Editing by Keith Weir and David Evans)