A recent surge in Twitter bots promoting anti-immigrant views in Sweden has sparked fears malign outside forces may be trying to influence the country's forthcoming election.

A study by Sweden's defence research agency discovered a sudden sharp rise in the number of automated Twitter accounts – with some 40 per cent of them favouring the anti-immigration Sweden Democrats party, which is expected to make gains in the poll on September 9.

It indicated the number of Twitter bots discussing politics nearly doubled from July to August, adding users "may be led to believe that this content (is) more widely accepted or more mainstream than it actually is".

The FOI agency, which analysed almost 600,000 tweets from more than 45,000 accounts, did not say who might be behind the fake accounts.

"Hopefully, this study will contribute to a greater awareness of possible effects of the bots, so more citizens make their decisions without being affected by them," researcher Johan Fernquist said.

Last year, Sweden's domestic intelligence agency briefed politicians about the potential risk of foreign inference in the vote to renew the 349-seat Riksdagen.

At the time, prime minister Stefan Lofven told Swedish broadcaster SVT that it has "become increasingly obvious that foreign powers are trying to influence an election and its outcome". He added that "obviously Russia was active in the US elections" and "we cannot assume that we are immune".

Four US intelligence agencies have concluded Moscow sought to influence the outcome of the race for the White House.

President Trump, after infamously failing to hold Vladimir Putin to account on the issue during a face-to-face meeting, subsequently said he holds his Russian counterpart personally responsible for the alleged efforts to interfere in the 2016 US election.

Polls suggest the Sweden Democrats - currently the country's third-largest political group, but considered a pariah in Swedish politics - could eclipse the main opposition, the liberal Moderates, to become the country's second-largest party.

Sweden's largest party, the ruling Social Democrats, built the country's famed welfare state.

The Sweden Democrats, born out of a radical nationalist movement with neo-Nazi links, has softened its rhetoric and expelled openly racist members. It gained popularity amid the debate about immigration, a key topic in the election.

The Scandinavian country of 10 million took in 163,000 refugees during the dramatic influx of migrants in Europe in 2015 - the highest per-capita rate in Europe.