Want the best of The Telegraph direct to your email and WhatsApp? Sign up to our free twice-daily Front Page newsletter and new audio briefings. An asylum seeker labelled a “serial offender” by a judge has been released from immigration detention after Home Office deportation attempts foundered.Detail of the 31-year-old man’s case has emerged in a ruling by Judge Martin McKenna following a High Court trial in London.The man, who has a history of mental health problems and was not named in the ruling, claimed that he had been unlawfully detained and wanted compensation from the Home Office.Judge McKenna dismissed the compensation claim but told how the man had arrived in the UK in 2003 and had been convicted of 17 offences over a seven-year period.The judge described the man as a “serial offender” – listing convictions for attempted robbery, criminal damage, drug crime and shoplifting – and said he had been assessed as “posing a high risk of harm to the public”.But the judge said the man had been released late in 2015 – after being held in immigration detention for more than 10 months – following fruitless deportation bids.Judge McKenna said the man, who had been born in a refugee camp in southern Algeria, claimed that he was “stateless”.He said Home Office staff had approached authorities in different parts of Africa – in a bid to deport – but officials had refused to provide travel documents to the man.”The claimant entered the United Kingdom in 2003. He claimed asylum in June 2003,” said the judge in his ruling.”In 2005 the claimant began to develop a mental health disorder. He has been treated as an inpatient in hospital since that time both on a voluntary and involuntary basis under mental health legislation.”He has had periods when he has been drinking heavily and periods when he has been street homeless. He has had periods when he has been suicidal and periods when he has self-harmed. He has been prescribed medication for his mental health condition.”Judge McKenna added: “The claimant is a serial offender. Between April 7 2005 and September 10 2012 he acquired 14 convictions for 17 separate offences including attempted robbery, criminal damage, drugs and numerous convictions for shoplifting.”He was assessed as posing a high risk of harm to the public.”Judge McKenna said the man had subsequently been detained under immigration legislation pending deportation.The man had claimed that he had been unlawfully detained between January and November 2015.Home Office officials disputed his claim.They said he had been a “serial absconder” and had committed “numerous criminal offences”.Staff said he had been held at a time where there had been a prospect of deportation – and they said reasonable deportation steps had been taken.Judge McKenna ruled in favour of the Home Office and dismissed the man’s claim for “unlawful detention”.