DETROIT (Reuters) - A federal judge halted late on Monday the deportation of all Iraqi nationals detained during immigration sweeps across the United States this month until at least July 10, expanding a stay he imposed last week.

FILE PHOTO: Protesters rally outside the federal court just before a hearing to consider a class-action lawsuit filed on behalf of Iraqi nationals facing deportation, in Detroit, Michigan, U.S., June 21, 2017. REUTERS/Rebecca Cook

The stay had initially only protected 114 detainees from the Detroit area.

U.S. District Judge Mark Goldsmith sided with lawyers from the American Civil Liberties Union who filed an amended complaint on Saturday seeking to prevent Immigration and Customs Enforcement (ICE) from deporting Iraqis from anywhere in the United States.

The ACLU argued those being deported could face persecution, torture, or death because many were Chaldean Catholics, Sunni Muslims, or Iraqi Kurds and that the groups were recognized as targets of ill-treatment in Iraq.

Goldsmith agreed with the ACLU on the grave consequences deportees may face, writing in his seven-page opinion and order that: “Such harm far outweighs any interest the Government may have in proceeding with the removals immediately.”

On Thursday, Goldsmith ordered a stay in the Michigan Iraqis’ deportation for at least two weeks while he decided whether he had jurisdiction over the merits of deporting immigrants who could face physical danger in their countries of origin.

He expanded his stay on Monday to the broader class of Iraqi nationals nationwide, saying it applies to the removal of all Iraqi nationals in the United States with final orders of removal who have been or will be detained by ICE.

There are 1,444 Iraqi nationals who have final deportation orders against them, although only 199 of them were detained as part of a nationwide sweep by immigration authorities, federal prosecutors said in court on Monday.

Those detained had convictions for serious crimes, including rape and kidnapping, ICE said.

Goldsmith also said his stays were designed to give detainees time to find legal representation to appeal against their deportation orders, and to give him time to weigh the question of his jurisdiction.

Daniel Lemisch, acting U.S. Attorney for the Eastern District of Michigan, called the opinion “highly extraordinary.”

“But it’s a very extraordinary circumstance because of the on-the-ground situation in Iraq,” Lemisch said by phone, referring to the danger faced by possible deportees.

ACLU attorney Lee Gelernt praised the ruling for saying that “the lives of these individuals should not depend on what part of the United States they reside and whether they could find a lawyer to file a federal court action.”

Goldsmith’s order came the same day the U.S. Supreme Court handed a victory to President Donald Trump by reviving parts of a travel ban on people from six Muslim-majority countries.

The roundup in Michigan followed Iraq’s agreement to accept deportees as part of a deal that removed the country from Trump’s revised temporary travel ban.

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.