The High Court has granted an appeal against its own ruling last month that the government's scheme to deport asylum seekers to Rwanda is lawful.
The controversial policy was introduced under Boris Johnson, but has been pushed forward by his successors as part of their plans to tackle small boats crossings in the Channel.
Campaigners have said it is a "cruel policy that will cause great human suffering", and fought through the courts to stop people being sent to the country.
But Home Secretary Suella Braverman said the government was "proud of the ground-breaking agreement".
In December, Care4Calais, the Public and Commercial Services Union, Detention Action, and eight asylum seekers brought their case to the High Court, along with a second case from Asylum Aid.
Their lawyers argued the plans were unlawful and that Rwanda "tortures and murders those it considers to be its opponents".
But representatives from the Home Office argued the agreement between the UK and the country provided assurances that everyone sent there would have a "safe and effective" refugee status determination procedure.
Lord Justice Lewis ruled the first people who were set to be sent to Rwanda had not had their circumstances "properly considered" by the then-home secretary Priti Patel.
As a result, their cases would be referred back to the current minister, Ms Braverman, "for her to consider afresh".
However, while he said the home secretary should look at people's "particular circumstances" before deporting them, he ruled the overall scheme was "consistent with the refugee convention" and therefore lawful.
After today's ruling by Judges Clive Lewis and Jonathan Swift, the groups and asylum seekers will be able to take their cases to the Court of Appeal.
The Rwanda scheme was announced by Mr Johnson last April, with the first flight set to take off two months later.
But the deportation was blocked by a last-minute ruling from the European Court of Human Rights, which imposed an injunction preventing any further flights until the conclusion of legal action.
Ms Braverman praised the initial ruling on the policy as lawful, saying the plan was a "humane" and "practical alternative" for those who come to the UK through "dangerous, illegal and unnecessary routes".
But opposition parties deemed it "unworkable", "unethical", and "extremely expensive".
Asked if the appeal was a setback for the government's plans, Ms Braverman told reporters: "The government is clear that we support and are proud of the ground-breaking agreement and partnership that we have struck with Rwanda so that we can deliver our plans to swiftly detain and remove those people who come here illegally to our country."