Victims of torture were illegally detained by the Home Office for immigration purposes, according to a High Court ruling on Tuesday.
Mr Justice Ouseley said the government infringed the human rights of seven people, who doctors accepted were tortured, by holding them in detention centres.
The ruling could change how the Home Office deals with many non-state victims of torture, who can currently be held for indefinite periods in Britain’s immigration removal centres.
The policy, known as "Adults at Risk", has since September 2016 defined torture as something only carried out by the state – meaning that victims of people trafficking, for example, could be held indefinitely regardless of any evidence they were tortured.
Ouseley's judgment said: "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 seven former detainees who brought the legal challenge include victims of sexual and physical abuse, trafficking, sexual exploitation, and homophobic attacks; a child abused by loan sharks; and a man kidnapped and abused by Taliban.
The Home Office’s position has always been that asylum-seekers who are victims of torture should not be held in detention except in exceptional circumstances. But in September 2016 the government redefined torture as something that is only meted out by the state.
None of the seven were recognised as torture victims, despite doctors' assessments to the contrary. In his judgment, Ouseley said the government had "ignored" the correct interpretation of what constituted torture.
The case was brought by the charity Medical Justice, with the help of the Equality and Human Rights Commission.
Emma Ginn, coordinator at Medical Justice, told BuzzFeed News: "This case is important because torture victims can be retraumatised by being held in immigration detention.
"This Home Office policy was meant to lessen the risk of harm caused by detention but actually likely increased it. Medical Justice volunteer doctors see vulnerable detainees who have deteriorated in detention to the extent that they had to be transferred to psychiatric units."
In a statement after the judgment, Ginn said: "Narrowing the definition of torture by the Home Office demonstrates its sheer contempt for vulnerable detainees whose lives it is responsible for. The Home Office should have welcomed our evidence of the policy’s harm suffered by torture victims, not dismissed it.
"There is ample justification for immediately releasing all detained adults at risk so they can access the care and support they need in the community."
For people like Mr O, a 33-year-old gay man from Nigeria, the case was a chance to get justice. He was held in immigration detention for six months last year after claiming asylum on the basis of his sexuality, despite evidence that he was a victim of a violent attack.
In Nigeria gay sex is punishable by up to 14 years' imprisonment, and anti-gay violence is rife. In 2002 Mr O says he was attacked by a gang of men along with his boyfriend because of his sexuality. His fingers were broken, and he was kicked and punched, beaten with a stick, and stabbed with a knife in his shoulder and calf.
A medico-legal report produced by a Medical Justice doctor while he was in detention, seen by BuzzFeed News, says his injuries are consistent with his account of the attack.
During his time in detention Mr O got flashbacks to the assault, and his mental health suffered. "You’re isolated; you don’t know anything," he told BuzzFeed News. "It made my mental and physical health deteriorate. I was having flashbacks, agitation, lack of concentration, and depression... It made me have these memories that if I go back to Nigeria things like this may happen."
Because the rules no longer require there to be "exceptional circumstances" to detain victims of violence like Mr O, he was kept in detention. The Home Office argued that the fact that he had overstayed a visitor’s visa outweighed any risk that continued detention could damage his health, as the doctor had not diagnosed any serious health conditions that would prevent him coping with a short period of detention.
After a court intervention Mr O was finally released from detention after six months and has made an appeal on his asylum case. But the experience had a lasting effect.
"I came to Britain thinking everyone has human rights, that you’re protected by the government and nothing is going to happen to you," he said. "I never thought they would treat people in this illegal manner."
He added: "They should recognise that torture is not only from the state… Torture is torture. They don’t need to be discriminating that it can only be the state."
Martha Spurrier, director of Liberty, said: "We welcome today’s ruling – but it is a damning indictment of our government that this sickening policy ever saw the light of day. In the UK in 2017, the home secretary ignored medical expertise, basic humanity, and the law to sign off a barbaric policy to lock up traumatised torture survivors.
"It is symptomatic of a vicious approach to immigration detention that sees thousands of people locked up in brutal conditions around the UK, with no certainty of when or if they will be released. Until that ends, this government is endorsing abuse."
David Isaac, chair of the Equality and Human Rights Commission, who intervened in the case, said: "People who have been subjected to torture should not be kept in immigration detention. This unlawful policy has been scrapped, but the government should now go further and strengthen the human rights protections for people in immigration detention.
"It is just one aspect of the government’s immigration detention programme that causes us serious concern. Following recent revelations about the treatment of people in immigration detention, we question the ability of the Home Office to ensure that companies contracted to run immigration detention facilities safeguard people’s basic rights. We are the only country in Europe that doesn’t have a statutory time limit on immigration detention and we continue to call for its introduction."
Jed Pennington of Bhatt Murphy Solicitors, who represented two of the former detainees, said: "It is shameful that the Home Office reintroduced a definition of torture that the High Court had already thrown out under the guise of a policy that is supposed to be more protective of vulnerable detainees. Adults at risk is fundamentally flawed and should be replaced with a framework that genuinely protects the vulnerable with, as a minimum, a prohibition on the detention of all victims of torture or trauma."
A Home Office spokesperson said of Mr O's situation: "We do not routinely comment on individual cases." They also said they would not comment on an ongoing court case.