Mr. Khalil, a legal permanent resident, has been held in Louisiana for more than three months. The judge suggested he could be released as early as Friday unless the government successfully appeals.
A federal judge on Wednesday barred the Trump administration from continuing to detain Mahmoud Khalil under a rarely cited law invoked by the secretary of state — and suggested that Mr. Khalil could be released as early as Friday.
However, the judge, Michael E. Farbiarz, paused his own order to give the administration a chance to appeal, saying it would not go into effect until 9:30 a.m. on Friday. And he left a pathway for the government to continue to detain Mr. Khalil for other reasons, though he suggested he would be skeptical were authorities to do so.
It was not clear whether the administration would appeal the order. A Justice Department spokesman and a spokeswoman for the Department of Homeland Security did not immediately respond to a request for comment.
Mr. Khalil, a Columbia University graduate and legal permanent resident, was detained in March, the first of a number of noncitizen student protesters to be arrested by the Trump administration as it began to scrutinize the pro-Palestinian protests that shook college campuses last year.
To justify Mr. Khalil’s arrest, Secretary of State Marco Rubio cited the rarely-used law, saying that Mr. Khalil’s presence in the United States threatens the country’s foreign policy interest of preventing antisemitism.
Judge Farbiarz had already found that the law itself was likely to be unconstitutional. On Wednesday, he found that Mr. Khalil had shown he would be irreparably harmed were he not released.