A high court judge in the United Kingdom on Monday ruled that hundreds of immigrants who had been tortured abroad have been illegally imprisoned in detention centres across the country, The Guardian reported. Justice Duncan Ouseley said that the UK Home Office policy, “Adults At Risk”, had wrongly allowed torture victims to be jailed because of a clause that defines torture as violence only when it is carried out by official state agents.

The ruling came after seven victims of serious torture along with Medical Justice, an organisation working to improve the health of detained immigrants, appealed in the court against the Home Office’s policy. The seven persons include victims of trafficking, a man kidnapped by the Taliban, and two men tortured because of their sexual orientation, The Guardian said.

Justice Ouseley said that the Home Office’s definition of torture lacked rational or evidence base. “The chief problem with the narrowed definition is that it excludes certain individuals whose experiences of the infliction of severe pain and suffering may indeed make them particularly vulnerable to harm in detention,” the judgement read.

One of the seven appellants, a Nigerian asylum seeker who was beaten, knifed and flogged in Nigeria because he is bisexual, said that although he had won the case, he would be unable to “erase the damaging effects” of his time in detention in the UK. “I felt very bad because of the torture I experienced in Nigeria but doctors confirmed that my mental state deteriorated as a result of being detained here,” he said, according to The Guardian.