Several months later, the Sept. 11 attacks touched off a period of heightened fears about Islamist terrorism, including sweeps aimed at rounding up and prosecuting or deporting hundreds of noncitizen Muslim men — like Mr. Hassoun.
Meanwhile, in November 2001, the Bush administration issued its regulation responding to the Zadvydas ruling. Among other things, it carved out an exception to the six-month release rule for foreigners deemed to be linked to terrorism. But that provision sat on the books, unused, for years.
Mr. Hassoun’s lawsuit challenging it may face steep obstacles, legal experts said.
The five-member conservative bloc that now controls the Supreme Court appears less sympathetic to people facing deportation than the court was in 2001. The court ruled 5 to 4 last week that immigrants facing deportation proceedings because they committed crimes, including minor ones for which they were released from criminal custody long ago, must be detained during that process without bail.
The Supreme Court will be unlikely to order Mr. Hassoun released if the Trump administration says he poses a security threat, predicted Jamil Jaffer, a George Mason University law professor who held several national-security positions in the Bush administration.
“The government’s hand is stronger when it comes to evaluating a national-security threat because courts generally give the president more deference in that space,” he said. “I just don’t see a court granting him relief.”
Stephen Vladeck, a University of Texas, Austin, law professor, noted that a provision in the USA Patriot Act, enacted in October 2001, creates a way for the attorney general to hold terrorism-linked foreigners in open-ended custody if they cannot be deported. While the government is not invoking that statute, he said, it may argue in court that its existence means the regulation is reasonable.
Several dozen noncitizens will complete prison sentences for terrorism-related crimes in the coming years, according to a database compiled by the Center on National Security at Fordham Law. Many are from troubled nations like Somalia where officials may be reluctant to repatriate them.
“The creation of any precedent will be a big deal,” Mr. Vladeck said. “Once there is case law on the books that the government is able to subject even some immigrants to perpetual detention, it’s not hard to imagine the government taking advantage of it.”