A Muslim man from Uganda who went to terror training camps in England cannot be deported because it is against his human rights.

Lawyers argued that 30-year-old YM, who cannot be named for legal reasons, has weak ties to his homeland and his removal would breach his rights to a family life despite committing serious criminal offences.

The man, who has been convicted of aggravated burglary among other charges, won his appeal against immediate removal back to Uganda by three senior judges at The Court of Appeal today.

Judges at The Court of Appeal ruled that the man, known only as YM, cannot be deported due to human rights

Lord Justice Aikens, Sir Colin Rimer and Sir Stanley Burnton ruled that YM – a married father-of-three – was entitled to have his case reconsidered by tribunal.

Sir Stanley said: ‘It would in general be difficult to see that in the case of someone who had committed offences as serious as those of the appellant the lack of ties to his country of nationality would lead to a breach of his Article 8 rights, since the public interest in his deportation is so strong.’

But the judge added that he was persuaded in this case to remit his appeal to the Upper Tribunal (UT) because of changes to relevant legislation and Immigration Rules since his case was last considered.

Lord Justice Aikens described how YM began to seriously practise Islam - the religion of his birth - whilst detained at a youth offender institution.

After his release on licence in 2005 he used to attend the Croydon Mosque, and that led him to go to meetings at the house of a man called Hamid ‘whom YM subsequently admitted was a fanatical Islamist’, said the judge.

‘These encounters resulted in YM attending two terrorist training camps [in southern England] in 2006.’

Born in Uganda in June 1984, YM came to the UK with his mother and her other children in 1991 at the age of six.

He obtained indefinite leave to remain when he was 16.

Lord Justice Aikens said: ‘His mother and siblings have obtained British nationality, but YM has not.

‘That is because he started to commit crimes when he was 14, his age when he was convicted of robbery.’

He was subsequently convicted of assault occasioning actual bodily harm when he was 15, three assaults on police constables when he was aged 18, and aggravated burglary when 19.

Sir Stanley Burnton (pictured) said he had been 'persuaded' in this case to remit his appeal

For the burglary offence he was sentenced at Croydon Crown Court in September 2003 to three years, six months in a youth offender institution.

He was warned in a letter from the then home secretary that ‘a serious view’ was taken of the aggravated burglary offence and he was at risk of being deported if he was the subject of ‘adverse notice’ in the future.

On the day of his release in March 2005 he married his wife in an Islamic wedding ceremony and the couple have gone on to have three children.

After a visit to the house of the ‘fanatical Islamist’ and attending terrorist training camps he was arrested.

YM was charged under section 8(2)(a) of the 2006 Terrorism Act which makes it an offence to attend a place where instruction or training, including with weapons, is given for terrorist purposes.

He pleaded guilty to two charges and in February 2008 at Woolwich Crown Court was sentenced to three years, five months in prison on each count, with the sentences running concurrently.

But because YM had been in custody since his arrest, he was released on licence in June 2008.

The judge said that a month earlier he had been served with a deportation notice by the Home Secretary, stating that his presence in the UK was ‘not conducive to the public good’ because of his terrorist-related convictions.

An Immigration and Appeal Tribunal (IAT) allowed YM’s initial appeal against the notice on human rights grounds in July 2009, but the decision was overturned by the Upper Tribunal (UT) and a fresh hearing ordered.

In May 2013, the UT heard evidence from YM and his wife and the mothers of the couple but rejected assertions that there was a real risk he would suffer inhuman and degrading treatment if sent back to Uganda, contrary to Article 3 of the human rights convention.

Although the appeal judges dismissed his challenge to the decision under Article 3, they ruled he was entitled to a rehearing by the tribunal on his Article 8 grounds.

Lord Justice Aikens said the Article 8 case raised issues over how revised Immigraton Rules were to be applied to YM’s case, but the central question for the court was what ties YM himself had with Uganda and whether they would support him if he was returned to that country.

He declared the UT had made three relevant errors of law on the issue and must now ‘conduct a proper factual enquiry and evaluation’ of those ties in the light of the new 2014 Immigration Rules.

An Al-Qaeda terrorist training camp in Afghanistan, pictured in 2001

In the court’s written judgment, the judge described how YM was involved in continuing clashes with the law after the IAT allowed his initial appeal against deportation in July 2009.

But the judge said the UT was correct to point out that he had not engaged in any terrorist activity since his release from prison in 2008, and there was no evidence that he was likely to in the future ‘whether in the UK or in Uganda’.

In August 2009 he was warned for contacting a co-defendant to the terrorist charges, with non-contact being a condition of being freed from prison on licence.

The judge said he was recalled to prison in December 2009 at the same time as being arrested on suspicion of handling stolen goods, although that charge was not pursued.

In January 2010 he was released on licence. In October 2011 he was given a caution for a ‘road rage’ incident.