“Hansen admitted to federal agents that no one had achieved U.S. citizenship through the program,” Judge Ronald M. Gould wrote for the panel in February, “and it is not possible to become a U.S. citizen through adult adoption.”

The panel upheld Mr. Hansen’s fraud convictions, which resulted in 20-year prison sentences, but it reversed his convictions under the 1986 law for encouraging immigrants to overstay their visas, which would have come with 10-year sentences to be served at the same time as the sentences for fraud.

The 1986 law, Judge Gould wrote, was unconstitutional. Under it, he wrote, “many commonplace statements and actions could be construed as encouraging or inducing an undocumented immigrant to come to or reside in the United States.” All it would take to turn an utterance into a felony, he wrote, was “knowingly telling an undocumented immigrant ‘I encourage you to reside in the United States.’”

Other statements that would violate the law, Judge Gould wrote, included ones “encouraging an undocumented immigrant to take shelter during a natural disaster, advising an undocumented immigrant about available social services, telling a tourist that she is unlikely to face serious consequences if she overstays her tourist visa or providing certain legal advice to undocumented immigrants.”

In July, a divided three-judge panel of the 10th Circuit, in Denver, joined the Ninth Circuit in striking down the law, saying that it was surely violated scores of times every day.

Later that month, the Ninth Circuit turned down the government’s request that a larger panel of the court rehear Mr. Hansen’s case, over the dissents of several judges. One of them, Judge Patrick J. Bumatay, said the key word in the 1986 law — “encourages” — was a term of art that required complicity in a crime and did not apply to casual exchanges.

It is true that prosecutions under the law have tended to be limited to cases concerning plainly criminal conduct by unsympathetic defendants. But there is at least one possible exception.