Hundreds of immigration removals are in doubt after the High Court ordered the Home Office to stop using a controversial "no warning" tactic.
A charity defending detainees has won an injunction after saying the policy breached the right to access justice.
Medical Justice said the policy prevented immigrants having a fair chance to put their case before they were put on a plane out of the country.
It said the policy had affected a huge range of people living in the UK.
These include members of the Windrush generation and victims of torture, it said.
Ordering the injunction, Mr Justice Walker told the Home Office to stop the removals, pending a full review of their lawfulness.
The decision means the Home Office must immediately cancel 69 removals scheduled for the coming days but during the hearing, the court heard that hundreds, if not thousands, of people were probably subject to the policy in any one year.
The challenge from the charity, represented by The Public Law Project, relates to a policy known as the "Removal Notice Window" in which an individual is given three days' notice that they will be removed on any day after that.
The individual can then be detained with no further warning - to all intents keeping secret the date of their removal and preventing many of them mounting an effective challenge.
Who has been affected?
In one example, a suicidal man with a serious mental illness was detained and removed on the same day - only for a judge to order the Home Office to bring him back because he had been denied the chance to put his case.
In another, a Jamaican man who had been living legally in the UK for decades was detained out of the blue.
It took him weeks to compile the comprehensive evidence of his right to live in the UK - and he narrowly avoided being placed on a removal flight.
Lawyers for the charity said the vast majority of those targeted had no time to prepare evidence or appeals which they were entitled to present to officials and the courts before a rush to remove them.
Charlotte Kilroy QC, for the charity, said the policy was a flagrant interference with the right to seek justice and amounted to a threat to the rule of law.
"The policy is hardwired to produce a situation where there's no access to justice in relation to the decision the secretary of state makes," she said.
"There is a significant risk that if interim relief [an injunction] is not granted, individuals will be removed without referral to the courts."
What happens now?
The Home Office's standard removal power remains lawful - meaning officials can still try to remove suspected illegal immigrants, providing they are giving a specific date of when it would happen.
Lawyers for the home secretary told the court that the Removal Notice Window policy had been introduced to prevent people deploying "last-minute attempts to sabotage removal" under the standard procedure.
But ruling against the policy, and halting its use, Mr Justice Walker said concerns raised by the charity meant there had to be a full examination in the summer of whether the policy was lawful.
Welcoming the decision, the charity said: "Denying extremely vulnerable people access to justice on this massive scale is a hidden issue causing serious harm and risking life."