•Rishi Sunak said the UK was working on a new treaty with Rwanda following the court's decision.
•The treaty would protect against the removal of asylum seekers from Rwanda back to their home country, he said.
The government is introducing emergency legislation to mark Rwanda as a safe country, the prime minister says, after the UK Supreme Court ruled the flagship asylum policy was unlawful.
Rishi Sunak said the UK was working on a new treaty with Rwanda following the court's decision.
The treaty would protect against the removal of asylum seekers from Rwanda back to their home country, he said.
"We need to end the merry-go-round" of legal challenges, he added.
Legal heads are being scratched as to how the emergency legislation might work
Declaring a country safe is not the same as proving to a court that it genuinely is - as the Supreme Court has shown.
The controversial plan to fly asylum seekers to Rwanda and ban them from returning to the UK - which has already cost at least £140m - has been subject to court challenges since it was first announced by Boris Johnson in April 2022.
No asylum seeker has been sent to Rwanda. The first flight was scheduled to go in June 2022 but was cancelled after an intervention from the European Court of Human Rights (ECHR).
The latest ruling from the Supreme Court - the highest court in the UK - determined that the plan in its current form was unlawful.
Addressing reporters at a Downing Street press conference, Mr Sunak said the new treaty and emergency legislation would address concerns and confirm Rwanda was a safe country.
But he said the plan could face further challenges from the ECHR.
"We must be honest about the fact that even once Parliament has changed the law here at home, we could still face challenges from the European Court of Human Rights in Strasbourg," he said.
"I will not allow a foreign court to block these flights. If the Strasbourg court chooses to intervene against the expressed wishes of Parliament, I am prepared to do what is necessary to get flights off."
The legal case against the policy hinges on the principle of "non-refoulement" - that a person seeking asylum should not be returned to their country of origin if doing so would put them at risk of harm - which is established under both UK and international human rights law.
In their ruling, the Supreme Court justices said there were "substantial grounds" to believe people deported to Rwanda could then be sent, by the Rwandan government, to places where they would be unsafe.
The treaty Mr Sunak said the government was working on with Rwanda aims to address this, suggesting the Rwanda government will promise never to send a genuine refugee back to where they had fled from.
But there are concerns Rwanda would not follow through on this promise.
Mr Sunak is facing pressure from a significant section of his party over immigration.
He has promised to "do what is necessary" to enact the Rwanda policy, but it is not clear yet how far he would go.
Many expect a new treaty to be challenged in the courts and Tory MPs will be demanding more detail on how he thinks he can circumvent human rights laws and international conventions.
If Mr Sunak takes the step of saying the European Convention on Human Rights no longer applies to sending people to Rwanda, that would deal with one part of his problem.
But the Supreme Court also said three separate British laws stand in the way.
So the government might have to change all these laws - and that's quite a feat to pull off when political time is running out.
It normally takes several months for legislation to pass, but with emergency legislation, the government can make sure it happens more quickly.
All the stages in the House of Commons can be done in as little as a single day. The same is true for the House of Lords - although it is a lot harder for the government to force the pace there if they face opposition.
Mr Sunak said the government wanted to see flights to Rwanda take off by next spring "as planned".
But he carefully avoided promising flights would leave before the next general election, widely expected to be held next year.
The failure of the flagship immigration policy came in a week when the prime minister sacked his home secretary, Suella Braverman, who had championed it.
She had accused him of not having an alternative plan to the Rwanda policy. After the news conference, an ally of Mrs Braverman said: "This is a treaty which he's putting in legislation - it's just another version of Plan A. He'll be stuck in the courts again."
Labour's shadow home secretary Yvette Cooper accused Mr Sunak of "making more promises and chasing more headlines".
Ministers had known what the problems with the scheme were 18 months ago, she said, adding "if they thought this was the answer, why didn't they do it long ago?"
The Rwandan government has taken issue with the Supreme Court, saying that, while it was a decision for the UK's judicial system, the ruling that Rwanda was not a safe country for asylum seekers was unjustified "given Rwanda's welcoming policy and our record of caring for refugees".
In its judgement, the Supreme Court said the Rwandan government had entered into the agreement in "good faith" but the evidence cast doubt on its "practical ability to fulfil its assurances, at least in the short term", to fix "deficiencies" in its asylum system and see through "the scale of the changes in procedure, understanding and culture which are required".
One asylum seeker told the BBC he thanked the judges "from the bottom of my heart" for their ruling, adding "they treated us with humanity".
Charities, including Oxfam, have welcomed the court's decision and called for the government to look at alternative policies, including opening more legal routes for those seeking asylum.