Last Friday, only hours after the terrorist attack in central Stockholm, police found themselves pelted by rocks in the city’s largely immigrant Tensta neighbourhood. The following evening, officers were once again attacked, this time in Hammarkullen in Gothenburg. On Sunday, a familiar story: rioters aimed Molotov cocktails and a fire bomb at police as unrest broke out in the area. In the days following the truck attack, Swedish newspapers had been full of defiant headlines: ‘Stockholm stands united’ and ‘Love conquers all.’ But the subsequent violence put paid to much of that: ‘Unity’ and ‘love’ are, for many Swedes, not the words that spring instantly to mind.

Much is still unknown of Rakhmat Akilov, who has admitted to driving the truck; what is clear is that he is an Uzbek national who was ordered to leave Sweden after his asylum application was rejected last summer. Police listed him as officially ‘wanted’ on February 27 – but only after he had already disappeared.

And he is not alone. For Akilov belongs to a growing population of illegal residents in Sweden –­ in some estimates, as many as 75 per cent of failed asylum seekers who are due to be expelled by police – who have simply vanished underground. According to the Swedish Border Police, around 12,500 are missing, while the Swedish Migration Agency says it expects another 50,000 to go to ground in the next four years.

Why is it that the Swedish police is having such difficulties in sending back illegals? One reason is chronic understaffing: in Stockholm, 20 border police officers are expected to search for 4,000 missing immigrants, an impossible task.

Another is the lack of political support. Four years ago, a campaign to identify illegal immigrants in the capital, including ID checks in its subway, was met by huge protests from opinion makers and politicians, who argued that internal immigration controls were inherently immoral or even racist. Sweden’s Social Democratic minister of justice, Morgan Johansson – chairman of the Parliamentary Justice Committee at the time – even claimed the government should give the police directives to chase criminals instead of undocumented migrants. ‘Only four per cent of home burglaries are solved,’ he said. ‘If I were to decide, the police would prioritise such crimes instead.’

Thirdly, Sweden’s previous centre-right government, led by the Moderate Party, introduced reforms giving illegal immigrants additional financial incentives to stay in the country, including the right to tax-funded healthcare and schooling. They also brought in a somewhat schizophrenic approach to the problem: those being hunted by police could, at the same time, be granted welfare payments to support their stay in Sweden. Akilov is a father of four. If his children are in Sweden – which is not yet known – it means that the family has the right to live on taxpayers’ money, something that has outraged many Swedes. But the Moderate Party appears to have forgotten its role in this mess. Instead, its current leader, Anna Kinberg Batra, tweeted on Monday: ‘If one is not allowed to be in Sweden, one should be sent away. If that had worked, the 39-year-old [Akilov] would not have been on Drottninggatan on Friday.’

If the government has repeatedly failed to address the problem of Sweden’s underground problem, so too has it failed to take seriously the threat posed by jihadism. Sweden is one of Europe’s leading per capita exporters of Isis fighters; unlike Norway, it is not illegal here to be a member of a terrorist organisation, and any attempt to make it so have been defeated with reference to freedom of association. As a consequence, returning Swedish Isis fighters cannot be prosecuted unless it can be proved they have committed war crimes during their time abroad. It means the Swedish Security Service is currently monitoring some 150 returning jihadists – with little or no possibility of taking further action. And only last week, the prime minister was forced to remove responsibility for Sweden’s policies against extremism from Alice Bah Kuhnke, the minister of culture and democracy, after she appeared on TV praising a programme for receiving returning Isis fighters in the city of Umeå. There is no such programme.

Then there is the question of accountability. In recent years, a number of ministers have had to resign because of minor transgressions in their personal lives – the education minister for drink-driving; another minister for failing to pay her TV licence – but when a whole policy area fails, no one is expected to quit.

That could all be changing. If the poll numbers of the Sweden Democrats (SD) –– Sweden’s anti-establishment, anti-immigration party –– are anything to go by, they give a good estimate of the discontent among voters. The SD, who did not enter the Swedish parliament until 2010, is currently the second biggest party. After Friday's attack, Sweden is now a divided country, both socially as well as politically.

Paulina Neuding, a co-founder of the Freedom Rights Project, is a columnist with the Swedish newspapers Svenska Dagbladet and Göteborgs-Posten