Ravi Ragbir became an immigrant rights activist from his own experience. After coming to the United States from Trinidad and Tobago and becoming a legal resident, he was convicted of wire fraud in 200 0 and, after completing his prison sentence, was ordered deported. Since then, he had been allowed to remain in the country only at the discretion of immigration officials. Last year, it seems, their patience ran out.

Mr. Ragbir, during a routine check-in with Immigration and Customs Enforcement agents in Lower Manhattan, was told that he was being detained and would be deported. Under the Trump administration, this experience is alarmingly common, even for those like Mr. Ragbir with strong family ties in the United States and with an American spouse. One thing stood out in this case: Mr. Ragbir was the executive director of the New Sanctuary Coalition — a group dedicated to assisting immigrants — and he was one of a number of immigration activists ordered detained or deported within a matter of weeks.

On Thursday , a federal appeals court ruled that in seeking to deport Mr. Ragbir, ICE may have exceeded its authority and violated his constitutional rights as a critic of the government’s immigration policies.

The court ruled that Mr. Ragbir had made a “plausible” case that the “public expression of his criticism, and its prominence, played a significant role in the recent attempts to remove him” — a type of retaliation forbidden by the First Amendment.