Under the Rwanda plan, which has yet to be carried out, asylum seekers who arrive on England's southern coast in small, inflatable boats would be sent to Rwanda.
In an effort to overcome resistance from the courts who have ruled the plan is unlawful, Britain signed a treaty last year with Rwanda, in which it agreed to address safety concerns, and the government is trying to pass legislation through parliament that would block legal challenges to deportations.
Although ministers could take steps to ignore the motion, lawmakers in the House of Lords backed it 214 votes to 171, providing the first public indication of the scale of opposition to the government's new legislation in the upper chamber.
Peter Goldsmith, an attorney general under former Prime Minister Tony Blair, who laid the motion, said before the vote it was the first time that lawmakers in the Lords had used parliamentary powers to vote to halt the ratification of a treaty.
Sunak has said he wants the first deportation flights to leave in the next few months - ahead of a general election expected in the second half of this year - so he can meet one of his five pledges to "stop the boats."
The government passed the Rwanda legislation in the House of Commons last week after days of debate that showed deep divisions in the governing Conservative Party.
The level of opposition in the House of Lords is expected to debate the bill for the first time at the end of January with crunch votes likely to come in March.
The Lords are likely to add make amendments to the legislation and could in extreme circumstances delay the bill for a year, which would mean it could not be passed until after the next election.
Forum