A federal judge on Monday indefinitely stopped the deportation of more than 1,400 Iraqis who fear physical harm if kicked out of the U.S., the latest in a series of decisions in favor of the immigrants.

The injunction by U.S. District Judge Mark Goldsmith in Detroit will allow the Iraqis, many of whom are Christian, to stay in the U.S. while they try to persuade immigration courts to overturn the deportations based on risks back in their native country. The 34-page order was released Monday just hours before an earlier ruling was set to expire.

Roughly 230 people are in custody. The remaining 1,200 are not locked up but could be arrested at any time.

"Each petitioner faces the risk of torture or death on the basis of residence in America and publicized criminal records. Many will also face persecution as a result of a particular religious affiliation," the judge said.

The decision effectively means no Iraqi nationals can be deported from the United States for several months.

It was not immediately known whether Goldsmith's ruling would be appealed by the U.S. government. A representative for the U.S. Attorney's Office in Detroit did not immediately respond to a request for comment.

The American Civil Liberties Union (ACLU) sued on June 15 to halt the deportations of the detainees, which had been mainly convicted of serious crimes, ranging from homicide to weapons and drug charges, the U.S. government said.

Goldsmith sided with the ACLU, expanding on June 26 an earlier stay which only protected 114 detainees from the Detroit area to the broader class of more than 1,400 Iraqi nationals nationwide.

The ACLU argued many Iraqi detainees have had difficulty obtaining critical government documents needed to file deportation order appeals, and also that the government has transferred many detainees to facilities in different parts of the country, separating them from their lawyers and families.

"The judge is giving them a realistic and meaningful opportunity to make their cases," ACLU attorney Miriam Aukerman said after the decision.

The roundup of Iraqis in the Detroit area followed Iraq's agreement to accept deportees as part of a deal that removed the country from Trump's revised temporary travel ban on people from six Muslim-majority countries.

Some of those affected came to the United States as children and committed their crimes decades ago, but they had been allowed to stay because Iraq previously declined to issue travel documents for them.

That changed after the two governments came to the agreement in March.