Since Mr. Trump signed his order on Jan. 27, there has been widespread confusion over the policy and disagreement over how it was being carried out, flummoxing immigration lawyers, government officials and travelers. Shortly before the Seattle ruling, a different federal judge, Nathaniel M. Gorton in Boston, ruled in favor of the government by declining to extend a temporary halt to the order in that jurisdiction.

Judge Gorton, who was appointed to the bench by the first President George Bush, said that while the nation’s immigration history was a source of great pride and that the plaintiffs in that case — Iranian nationals who are academics — had compelling stories, “the public interest in safety and security in this ever more dangerous world is strong as well.”

But that ruling was soon rendered moot, at least for now, by the Seattle ruling.

The administration has been criticized for issuing its order without any warning to refugees and visa holders who were on their way to the United States. Some arrived at airports for flights and were turned away.

The president’s order allowed for exceptions in the “national interest,” but lawyers for some travelers had described getting one as a Kafkaesque exercise, with the State Department’s website warning that no emergency applications would be heard, and Customs and Border Protection agents at United States airports all but unreachable because their clients were not being allowed to board planes.