A five-judge panel at the UK's highest court unanimously sided with Court of Appeal judges that the policy was incompatible with Britain's obligations under international treaties.
"We conclude that the Court of Appeal... was entitled to find that there are substantial grounds for believing that the removal of the claimants to Rwanda would expose them to a real risk of ill-treatment," they concluded.
The judges agreed with the lower court's June verdict that Rwanda risked forcibly returning asylum seekers and refugees to a country where they could face persecution, in a move known as refoulement.
"Having been taken through the evidence we agree with their conclusion," they added in their 56-page ruling.
Sunak's ruling Conservatives have insisted the Rwanda scheme is crucial to reduce "illegal" immigration across the Channel on small boats — an issue set to feature prominently in the next general election.
But the ruling ends a saga that began in April last year when Britain signed a deal with Rwanda to send undocumented migrants to interim centers there, and leaves the UK leader's immigration agenda in tatters.
It is also set to widen rifts in the ruling Tory party between right-wing lawmakers and moderates.
Sunak said the ruling was "not the outcome we wanted" and the government "will now consider next steps" while ministers in Kigali "take issue" with the ruling that Rwanda was not a safe third country.
'Stop the boats'
Hardliner Suella Braverman launched a scathing attack on Sunak Tuesday, the day after she was fired as interior minister, accusing him of "betrayal" and "magical thinking" over the policy.
She wants Britain to leave or disregard the European Court of Human Rights (ECHR) and "any other obligations which inhibit our ability to remove those with no right to be in the UK."
The Migration and Economic Development Partnership envisages sending to Rwanda anyone who has made what the government calls "dangerous or illegal journeys, such as by small boat or hidden lorries" to the UK.
The government insists it is essential to deter migrants trying to cross the Channel from northern France in rudimentary small vessels.
More than 27,000 have made the journey this year.
The government passed legislation in July barring any "illegal" arrivals from claiming asylum.
Sunak's pledge to "stop the boats" is one of his five key priorities for this year, after succeeding Liz Truss in October 2022.
His administration says regular and irregular immigration must be slashed to ease pressure on housing and other social services, such as health.
Opponents decry the Rwanda policy as cruel, expensive and difficult to implement. They also argue it is in breach of international law on asylum and refugees.
The first deportees were on a plane and ready to fly to Rwanda in June 2022 when a last-minute ECHR injunction prevented any deportations.
The High Court had ruled the plan broadly lawful, but the senior courts have now quashed that.
'Disgraceful'
The Supreme Court ruling forces the government back to the drawing board to try to drive down asylum seeker numbers, with speculation it may try to strike deals with other countries.
It is also expected to renew demands from right-wingers that Britain withdraw from the ECHR -- a drastic idea that Sunak has so far refused to back.
In her excoriating letter Braverman, who has called sending asylum seekers to Rwanda her "dream" and "obsession," accused the prime minister of having "no appetite for doing what is necessary" on immigration.
She is widely believed to covet the Tory leadership and her hardline stance on the issue is seen as red meat to the party's grassroots.
But Sunak's surprise appointment of ex-prime minister David Cameron as foreign secretary and switch of James Cleverly to the interior ministry suggests he is halting his party's post-Brexit lurch to the right.
Migrant advocates welcomed Wednesday's court ruling.
The Refugee Council said it was a "victory for the rights of men, women and children who simply want to be safe."
Sacha Deshmukh, chief executive of Amnesty International's UK arm, urged ministers to "now draw a line under a disgraceful chapter in the UK's political history."