Donald Trump supporters have been accused of opportunism after using the Stockholm lorry attack to claim he was right all along about Sweden.

In February the US President made a seemingly confused reference to a non-existent terror attack when he told a rally of supporters: “We’ve got to keep our country safe … Look at what’s happening in Germany, look at what happened last night in Sweden. They took in large numbers [of immigrants], they’re having problems like they never thought possible.”

The president was widely ridiculed because nothing of particular note – and certainly no terrorist attack - had happened the previous night in Sweden. Former Swedish Prime Minister Carl Bildt mockingly asked: “What has he been smoking?”

Mr Trump later ‘clarified’ that he had in fact been referring to a Fox News item which included a clip from a film by a documentary maker who had said he wanted to “investigate why Sweden has become the rape capital of Europe” after admitting “over 350,000 Syrian refugees.”

Which only led to the rapid debunking of the claim that Sweden was the rape capital of Europe.

President Trump cites terrorist incident in Sweden that never happened

But within hours of the Stockholm attack claiming the lives of at least three people, Trump supporters were using social media to declare that the US president had been right all along.

Apparently ignoring Mr Trump’s backtracking that he had been referring to the rape, not terror threat in Sweden, his supporters claimed that he had prophetically “warned everyone”.

While some supported the notion, others accused those posting of opportunism.

While others pointed out a few flaws in the arguments of those seeking to claim that Mr Trump had been right all along.

The debate has some similarities to that which occurred two days after Mr Trump made his rally comments, when rioting broke out in the Stockholm suburb of Rinkeby.

This prompted right-wing commentators to argue that Mr Trump had been right to criticise a Swedish immigration policy that saw the country admit 163,000 asylum seekers in 2015, more refugees per capita than anywhere else in Europe.

In pictures: Stockholm truck attack Show all 15 1 /15 In pictures: Stockholm truck attack In pictures: Stockholm truck attack 3 people dead when a truck crashed into Ahlens department store in central Stockholm, Sweden Rex In pictures: Stockholm truck attack People were killed when a truck crashed into department store Ahlens on Drottninggatan, in central Stockholm Reuters In pictures: Stockholm truck attack Special Police forces work at the scene where a truck crashed into the Ahlens department store at Drottninggatan in central Stockholm Getty Images In pictures: Stockholm truck attack Woman is assisted at the scene after a truck crashed into an Ahlens department store in Stockholm Rex In pictures: Stockholm truck attack A policewoman in a gas mask operates at the scene where a truck crashed into the Ahlens department store at Drottninggatan in central Stockholm Getty Images In pictures: Stockholm truck attack People react at the scene where a truck crashed into the Ahlens department store at Drottninggatan in central Stockholm Rex In pictures: Stockholm truck attack Reports say three people have died after a truck crashed into an Ahlens department store in Stockholm Rex In pictures: Stockholm truck attack Armed police operates at the scene where a truck crashed into the Ahlens department store at Drottninggatan in central Stockholm Getty Images In pictures: Stockholm truck attack People react at the scene where a truck crashed into the Ahlens department store at Drottninggatan in central Stockholm Getty Images In pictures: Stockholm truck attack Emergency services close to the scene of an incident in Drottninggatan, a street in the centre of Stockholm, Sweden Lasse Gare/PA Wire In pictures: Stockholm truck attack Passers react at the scene where a truck crashed into the Ahlens department store at Drottninggatan in central Stockholm Getty Images In pictures: Stockholm truck attack People killed in incident when a truck was driven into a department store in central Stockholm Reuters In pictures: Stockholm truck attack Police officers work at the scene where a truck crashed into the Ahlens department store at Drottninggatan in central Stockholm Getty Images In pictures: Stockholm truck attack A general view shows a Ahlens department store after a truck reportedly crashed into it, at Drottninggatan in central Stockholm, Sweden EPA In pictures: Stockholm truck attack A view of a street after a truck reportedly crashed into a department store in central Stockholm, Sweden EPA

At that stage, though, the right-wing commentators were at pains to stress that it was “incorrect” to say Mr Trump had been referring to terrorism. They instead emphasised that he had been talking about a “break down in law and order” in Sweden.

They said that Rinkeby, where more than 90% of residents were born abroad or have foreign-born parents, was known locally as “Little Mogadishu”.

One police officer was quoted as saying he watched the riot and suggested to a colleague: “Perhaps Trump was right after all.” He later insisted, however, that he supported Sweden’s open immigration policy.

Right-wing commentators also argued that Sweden’s relatively low overall crime rates masked areas of high crime, ethnic isolation and joblessness. They quoted figures showing that while only five per cent of 15-74-year-old Swedish-born workers are jobless, foreign-born workers are three times more likely to be unemployed, and 22.5 per cent of immigrants from outside the EU are out of work.

Others, however, sought to put Sweden’s problems into perspective – among them those in Rinkeby itself.

Jamal Raheem, visiting Rinkeby on a two-week holiday from his home in east London told The Guardian: “Rinkeby is not dangerous. It’s a lot more dangerous in Stratford.”

Official figures suggested he might be right.

With 2,405 violent crimes reported per 100,000 residents in 2016, the Rinkeby-Kista district was the most dangerous place in Stockholm outside the city centre.

But even that figure – comparatively high by Swedish standards – was below the reported violent crime rate of 2,900 per 100,000 for the UK as a whole.