London has been battered by 50mph winds that have felled trees and caused travel chaos. Powerful gusts swept across the capital as the Met Office issued a yellow "be aware" weather alert for most of the country.

Home Secretary Theresa May has lost a human rights fight with a convicted Somalian criminal she wants to deport after a High Court judge complained of officials' "incompetence".

Mrs Justice Lang ruled that 33-year-old Abdi Ismail, who has a history of violence and has served a number of jail terms, had been detained for too long pending deportation and ordered his release.

The judge said detention had been prolonged unreasonably because of Home Office "incompetence, neglect and failure to show due diligence".

She said inquiries into Mr Ismail's family life had been "dilatory" and described the standard of a UK Border Agency investigation as "low".

Mrs Justice Lang said Mr Ismail, who had been detained for 18 months, was held pending deportation following a conviction for assault.

She said he had taken legal action, arguing that his continuing detention was unlawful and a unfair denial of a right to liberty enshrined in Article 5 of the European Convention on Human Rights. Mrs May had disputed the claim at a High Court hearing in London.

The judge said the Home Office's initial decision to detain was justified. But she said investigations should have been completed within a year and Mr Ismail had been held too long.

"It was prolonged for an unreasonably long period as a result of (Home Office) incompetence, neglect and failure to show due diligence," said the judge in a written ruling.

"(He has) been in immigration detention for 18 months. There is likely to be a further delay of at least a year before the deportation appeal process is concluded.

"These are lengthy periods of time which, having regard to the risk of re-offending and absconding, I do not consider are justified."

Mrs Justice Lang said Mr Ismail had arrived in the UK in 1993 after members of his family fled to escape civil war in Somalia. He had worked in a variety of jobs, married and fathered two children and divorced and lived in London and Leicestershire.

He had been convicted of a string of crimes over a decade, including racially aggravated threatening behaviour and assault on police.

Home Office officials decided to deport him after he attacked a friend with a knife, was convicted of assault occasioning actual bodily harm and given a 15-month jail term by a judge at Harrow Crown Court in 2011.

Mrs Justice Lang said Mr Ismail should be released subject to residence and reporting conditions and fitted with a monitoring tag pending rulings on his deportation.

The judge said Mr Ismail had claimed damages for false imprisonment. But she made no decisions about any compensation award in the ruling.