HOUSTON — A federal judge on Friday ordered the release of children held with their parents in U.S. immigration jails and denounced the Trump administration’s prolonged detention of families during the coronavirus pandemic.

U.S. District Judge Dolly Gee’s order applies to children held for more than 20 days at three family detention centers in Texas and Pennsylvania operated by U.S. Immigration and Customs Enforcement. Some have been detained since last year.

Citing the recent spread of the virus in two of the three facilities, Gee set a deadline of July 17 for children to either be released with their parents or sent to family sponsors.

BORDER PATROL PROBE UNDERWAY IN CALIFORNIA AFTER 11 PEOPLE ARRIVE BY BOAT, FLEE

The family detention centers “are ‘on fire’ and there is no more time for half measures," she wrote.

Gee's order said ICE was detaining 124 children in its centers, which are separate from U.S. Department of Health and Human Services facilities for unaccompanied children that were holding around 1,000 children in early June. The numbers in both systems have fallen significantly since earlier in the Trump administration because the U.S. is expelling most people trying to cross the border or requiring them to wait for their immigration cases in Mexico.

​​​​​​​Immigrants seeking asylum hold hands as they leave a cafeteria at the ICE South Texas Family Residential Center in Dilley, Texas, Aug. 23, 2019. (Associated Press)

Gee oversees a long-running court settlement governing the U.S. government’s treatment of immigrant children known as the Flores agreement. Her order does not directly apply to the parents detained with their children.

Gee’s order says ICE can decline to release a child if there is not a suitable sponsor, the child’s parent waives rights under the Flores agreement, or if there is a “prior unexplained failure to appear at a scheduled hearing.”

ICE did not respond to a request for comment Friday.

But most parents last month refused to designate a sponsor when ICE officials unexpectedly asked them who could take their children if the adults remained detained, according to lawyers for the families. The agency said then it was conducting a “routine parole review consistent with the law” and Gee’s previous orders.

Advocates contend that ICE should release all families from detention especially as the coronavirus has spread rapidly through immigration detention. In court filings revealed Thursday, ICE said 11 children and parents have tested positive for COVID-19 at the family detention center in Karnes City, Texas.

At the detention center in nearby Dilley, at least three parents and children — including a child who turned 2 this week — were placed in isolation after two private contractors and an ICE official tested positive for the virus.

Amy Maldonado, an attorney who works with detained families, said Gee “clearly recognized that the government is not willing to protect the health and safety of the children, which is their obligation.”

“They need to make the sensible choice and release the parents to care for their children,” she said of the government.

CLICK HERE TO GET THE FOX NEWS APP

For most people, the new coronavirus causes mild or moderate symptoms, such as fever and cough that clear up in two to three weeks. For some, especially older adults and people with existing health problems, it can cause more severe illness, including pneumonia and death. The vast majority of people recover.

More than 2,500 people in ICE custody have tested positive for COVID-19. The agency says it has released at least 900 people considered to have heightened medical risk and reduced the populations at its three family detention centers. But in court filings last month, ICE said it considered most of the people in family detention to be flight risks because they had pending deportation orders or cases under review.