The European Court of Justice has ruled against the Swedish government’s decision to deport a terrorist asylum seeker claiming that he must remain in Sweden because he could face potential torture in his native Morocco.

The Moroccan asylum seeker came to Sweden in 2005 but in 2016 the Swedish security service (Säpo) determined that the man was a security threat to Sweden and recommended he be deported. Both the Swedish Migration Board and the Swedish supreme court agreed with the Säpo, but the migrant took his case to the European Court of Justice (ECJ) who sided with him, Svenska Dagbladet reports.

Swedish terrorism expert Magnus Ranstorp slammed the move saying it makes the job of security services harder because although they can request the deportation of dangerous individuals, rulings like the one by the ECJ show it to be impossible to actually deport them.

Ranstorp added that the problem was not limited to Sweden and that there was a Europe-wide issue with an inability to deport dangerous Islamic extremists to their home countries.

While they may not be able to deport migrants with terrorist links, European Union member states are not required to grant them asylum. The ECJ ruled last year that EU states may reject the asylum applications of any individuals with links to terrorist groups even if they have not engaged in terrorist activity themselves.

Swedish Intelligence: Country Now Has 2,000 Radical Violent Islamists https://t.co/UlkZlBvXsq — Breitbart London (@BreitbartLondon) July 4, 2017

Sweden has seen a massive rise in the number of radical Islamic extremists since the height of the migrant crisis in 2015, with Säpo revealing that they have been watching around 2,000 Islamic extremists they deem to be violent and likely to commit violent acts.

Only seven years prior, the agency claimed there had been only 200 or so violent Islamic extremists in the country.

The lack of deportations of both criminal asylum seekers and failed asylum seekers has led to criticism from the populist Sweden Democrats party (SD).

Ahead of this year’s national elections, the SD released a video slamming the current government and SD leader Jimmie Åkesson accused the Migration Board of engaging in pro-migrant activism saying that they should focus on deporting failed migrants instead.