In a split two-to-one ruling, three Court of Appeal judges said Rwanda could not be considered a “safe third country” where migrants could be sent.

But the judges said that a policy of deporting asylum seekers to another country was not in itself illegal, and the government said it would challenge the ruling at the U.K. Supreme Court. It has until July 6 to lodge an appeal.

Human rights groups say it is immoral and inhumane to send people more than 4,000 miles (6,400 kilometers) to a country they don’t want to live in, and argue that most Channel migrants are desperate people who have no authorized way to come to the U.K. They also cite Rwanda’s poor human rights record, including allegations of torture and killings of government opponents.

Britain has already paid Rwanda 140 million pounds ($170 k) under the deal, but no one has yet been deported there.