The federal judge overseeing a 1997 court settlement that governs the care of migrant children in U.S. government custody ordered the Trump administration on Friday to promptly release minors from immigration detention, finding yet again that officials are violating the long-standing agreement.

Judge Dolly Gee of the U.S. District Court in Los Angeles found that U.S. Immigration and Customs Enforcement, which detains migrant families with children, and the Office of Refugee Resettlement, which has custody over unaccompanied minors, are both violating the Flores Settlement Agreement during the coronavirus pandemic, for distinct reasons.

Over the years and throughout different administrations, Gee has found that the government has violated elements of the settlement, primarily its requirement that migrant children be released from custody without "unnecessary delay." But Friday's order considered the risks faced by immigrants detained in close quarters during a deadly, global pandemic. In a different order last month, Gee called immigration detention centers "hotbeds of contagion."

Get Breaking News Delivered to Your Inbox

The order applies to the approximately 2,100 unaccompanied minors in ORR custody, as well as the 342 children held with their families at the three ICE family detention centers. The government has released hundreds of migrant children since Gee issued a temporary restraining order in March requiring their quick release under the parameters of the Flores agreement. But on Friday, Gee said "greater speed" is needed to remove more minors from congregate settings.

Gee required both ICE and the U.S. refugee agency to "make every effort to promptly and safely" release the children in their custody who have sponsors, don't pose a danger to themselves or others and are not flight risks. She prohibited the agencies from using certain justifications to continue detaining minors.

Immigrants seeking asylum leave a cafeteria at the ICE South Texas Family Residential Center, Friday, Aug. 23, 2019, in Dilley, Texas. Eric Gay / AP

Gee said the U.S. refugee agency can't block the release of children with sponsors simply because they were formerly in Mexico with their family under the Migrant Protection Protocols and have a pending case linked to that program. Some parents returned to Mexico under the MPP policy have sent their children to seek asylum alone at the U.S. southern border, since unaccompanied minors can't be placed in the program, per government policy.

ICE, meanwhile, can't justify not releasing families with children because they are named in federal litigation or due to the fact that they are waiting for a decision by an immigration judge or for officials to adjudicate their credible fear screenings, the first step in the asylum process.

Gee also ordered the U.S. refugee agency to temporarily waive the fingerprint requirement for some immediate family members, distant relatives and unrelated adults seeking to sponsor unaccompanied migrant minors. While coronavirus shelter in place orders remain in effect, she said officials can release minors to these sponsors without fingerprinting them if that is not available, as long as red flags don't show up in their background checks. The sponsors also have to agree to submit fingerprints "as soon as practicable."

Friday's order stems from a request by lawyers involved in the decades-long Flores litigation for Gee to order the government to rapidly release all children with sponsors. This week, the attorneys said the release of minors is particularly urgent as the coronavirus continues to spread throughout facilities for detained immigrants.

At least 59 migrant children in ORR-overseen facilities in New York, Texas, Illinois and Pennsylvania have tested positive for coronavirus, according to the agency's latest tally. ICE has not reported any cases at the three family detention centers in Texas and Pennsylvania, but has identified at least 317 positive coronavirus test results among adults in its custody and 35 among direct detention center employees, as of Friday.

The U.S. refugee agency has discharged hundreds of children in recent weeks, with the number of minors in its care dwindling from more than 3,500 in early March to the current 2,100 in-custody population. But the agency has also been receiving very few children from border officials, who are now expelling most unauthorized migrants, including minors who arrive at the border alone, by invoking expansive turn-back powers under a public health order they say is designed to curb the spread of the coronavirus.

Gee said ICE deserved "some credit" for moving away from a "laggardly initial response" and implementing a "rapidly-evolving response to the pandemic" in the wake of the litigation by the children's lawyers. She also said she appreciated that ICE has released dozens of families in recent weeks. But she said the children's lawyers, through first-hand accounts from detained immigrants, have undercut the "optimistic portrait" of the agency's efforts to maintain "safe and sanitary" conditions for children, another Flores Settlement requirement.

Declarations by ICE "paint a picture of sanitary, social-distance-compliant, and medically appropriate facilities," but that picture is "tarnished by declarations of detainees and their legal services providers," Gee said.

"(Immigrants) report inaccessible or ineffective medical treatment, deteriorating health while in custody, insufficient soap and sanitation supplies, lack of thorough cleaning by staff, and insufficient use of (personal protective equipment) by staff or detainees," Gee wrote in her order.

Peter Schey, one of the two attorneys who filed the original lawsuit that prompted the Flores agreement, praised Friday's order.

"I think Judge Gee's order will result in an acceleration of the release of both accompanied and unaccompanied minors in the coming days and weeks as the judge made very clear the government's current policies are in breach of the settlement," Schey, the president of the Center for Human Rights and Constitutional Law, told CBS News.

"The order will put pressure on them to not slow down their releases of children in light of the COVID-19 pandemic," Schey added.

In her order, Gee also required court-appointed juvenile coordinators at ICE and the U.S. refugee agency to file monthly reports starting in May on the agencies' efforts to expedite the release of children and to protect them during the pandemic.

An ICE spokesperson said the agency is reviewing Friday's order. Officials at ORR did not respond to a request for comment.