A foreign criminal convicted of a terrorism offence in Britain has used refugee laws to overturn the Government’s bid to deport him, it can be revealed.

The Kenyan man is now free to apply to permanently stay in Britain despite admitting to having ‘an extremist mindset’, court papers show.

In one of the first cases of its kind, he successfully argued his rights as a refugee outweighed the risk he poses to the UK in a judgment that has just been made public.

It is not known why the couple said they would be at risk in Kenya. But Amnesty International and the UN have shared concern about the detention of suspected terrorists there [File photo]

The man, who can only be identified by the initials NF, claimed he would be subject to ‘ill treatment’ if sent to Kenya.

He was caught at Heathrow in 2011 returning from the east African nation with a huge haul of terrorist material stored on an iPod.

Court papers reveal this included audio files said to be made by Al Qaeda and images of armed persons with flags associated with Al Shabaab, a linked terror group.

Detectives later found more materials at his home. In 2013, NF was given a nine-month jail sentence for ‘possessing information useful to terrorism’.

In one of the first cases of its kind, he successfully argued his rights as a refugee outweighed the risk he poses to the UK in a judgment that has just been made public. The UK Border is pictured above in a stock image [File photo]

This consisted of a document entitled 39 Ways to Serve and Participate in Jihad, which the trial judge described as a ‘terrorists’ manual’.

The Home Secretary at the time then tried to deport NF and his wife KKA, who both lodged asylum claims to stay in Britain.

Home Office officials argued the couple were not entitled to humanitarian protection under the Refugee Convention because of the risk NF posed.

But despite hearing NF had accepted he had an ‘extremist mindset’, in 2016 immigration judges upheld an appeal by the Kenyan nationals.

It meant NF and KKA were allowed to remain in Britain and pursue an asylum claim.

The Home Secretary attempted to overturn that decision but a newly published judgment reveals the Government has lost.

Upper Tribunal vice-president Mark Ockelton and judge Mark O’Connor said the threshold for ‘threatening international peace and security’ had not been crossed.

David Davies, MP for Monmouth, said: ‘This goes to show how totally out of touch our courts have become... It’s absolutely insane that judges and the courts are allowing this to happen.’

A Home Office spokesman said: ‘We do not routinely comment on individual cases.’ The spokesman would not discuss the status of NF and KKA’s asylum claims.

It is not known why the couple said they would be at risk in Kenya. But Amnesty International and the UN have shared concern about the detention of suspected terrorists there.