In an impassioned rebuke of the Trump administration’s immigration practices, a Federal District Court judge in Manhattan Monday ordered the immediate release of the immigrant rights activist Ravi Ragbir, calling his abrupt detention on Jan. 11 unconstitutional and cruel.

Mr. Ragbir, a native of Trinidad and Tobago who has been ordered to leave the country by immigration officials, should have been entitled to “the freedom to say goodbye,” as Judge Katherine B. Forrest, of the United States District Court of the Southern District of New York, put it in her opinion.

“It ought not to be — and it has never before been — that those who have lived without incident in this country for years are subjected to treatment we associate with regimes we revile as unjust, regimes where those who have long lived in a country may be taken without notice from streets, home and work. And sent away," Judge Forrest said, reading from the written order she delivered soon after oral arguments.

“We are not that country; and woe be the day that we become that country under a fiction that laws allow it.”