And yet.

There was a sound legal reason for Justice Phelan to be addressing American practices and policies. The case concerned a 2002 agreement between the United States and Canada on the treatment of people fleeing persecution from other places, and the agreement itself requires compliance with international conventions on refugees and torture.

Under the deal, which became effective three years ago this month, people from other countries entering Canada from the United States by land could no longer ask for asylum, on the theory that they should have done so in the United States. (The agreement works in reverse, too, but most refugee traffic moves north.)

You get one bite at the asylum apple, the agreement says, because you will get a fair shake in either country.

But the deal, known as the Safe Third Country Agreement, sets conditions based on the international conventions, and Justice Phelan said the United States had in recent years not lived up to them. He acknowledged that an English court had turned back a similar challenge to American refugee policy in 2000. But things have changed since the Bush administration came to power, Justice Phelan said, and the reasons given in the English decision “clearly relate to a different time.”

Justice Phelan declared the 2002 agreement invalid.

It is not entirely clear what follows from that decision. The parties have further briefs to submit, and an appeal is likely. But it certainly seems possible that many thousands of refugees will again become able to make asylum claims in Canada.