A federal judge has found the United States government in contempt after authorities deported five young immigrants who were seeking to remain in the country under a programme for abused and neglected immigrant children.

US Magistrate Judge Nathanael Cousins issued the civil order last week after finding the Department of Homeland Security and US Citizenship and Immigration Services violated a 2018 preliminary injunction that required them to notify lawyers of any enforcement action against the young immigrants in a class-action lawsuit in California.

Despite the preliminary injunction, five immigrants who were seeking to stay in the US under a federal government programme for abused immigrant children were deported, and one of them was reportedly assaulted.

More:

Mary Tanagho Ross, appellate staff attorney at Public Counsel's Immigrants' Rights Project, said she learned of the deportations months after one of the immigrants was back in Guatemala, where he was attacked by gang members.

"It is shocking the defendants didn't do their part to make sure ICE complied with a federal court order and they literally sent kids back to the lion's den," she said on Wednesday.

A Department of Justice spokesman declined to comment on the case.

The lawsuit was settled last year between the US government and lawyers for immigrants who sought to be covered by the programme after they turned 18. Applications are allowed until age 21.

Tanagho Ross said she would never have learned of the deportations but for another lawyer who mentioned one of his clients had applied for the programme, which leads to a green card, but got deported after losing a case for asylum.

Migrants who are applying for asylum in the United States sitting down in a processing court set up in a tent in Laredo, Texas [File: Eric Gay/AP Photo]

The court ordered the agencies to return the five immigrants to the US by February 29 so long as they want to come back, and to pay $500 for each day after that each one remains out of the country.

One of them has already been returned and is in the custody of Immigration and Customs Enforcement, which plans to send him back to Guatemala in another two weeks now that the lawyers have been notified, the US government said in a court filing.

His application to the programme for abused children has been approved but he will likely have to wait more than two years for a green card due to a cap on the number allowed to be issued each year, the government said.

Tanagho Ross said lawyers will seek to block his deportation.

Migrants who are minors lining up to enter a tent at the Homestead Temporary Shelter for Unaccompanied Children in Homestead, Florida [File: Wilfredo Lee/AP Photo]

In a separate case on Wednesday, a judge in Arizona sided with migrants and asylum seekers who have long-complained about inhumane and unsanitary conditions in some Border Patrol facilities in the state.

The ruling came weeks after the conclusion of a seven-day trial in which lawyers for migrants who sued in 2015 argued that the agency holds immigrants in extremely cold, overcrowded, unsanitary and inhumane conditions.

The order makes permanent a preliminary injunction that US District Court Judge David C Bury issued in 2016 that requires the Tucson Sector to provide clean mats and thin blankets to migrants and asylum seekers held for longer than 12 hours and to allow them to clean themselves.

Bury is also banning the use of bathrooms for sleeping, which came to light during the trial this year, when video was shown of a man trying to reach a bathroom but failing to because migrants were sleeping in them.

Although the lawsuit predates last year's surge in immigrant arrivals, it illustrates some of the challenges posed when migrants are detained, especially if they are children.

Bury has been critical of the agency, saying it has done little to remedy issues, especially around overcrowding and migrants' inability to sleep.