A federal judge has ordered immigration officials to allow doctors and public health professionals into detention facilities housing migrant children to address safety and sanitation concerns.

U.S. District Judge Dolly Gee of California’s Central District asked on Friday for an independent monitor to ensure that the government quickly deals with the allegedly filthy conditions in Border Patrol facilities and that doctors assess the detained children’s medical needs, according to The New York Times. Gee gave a July 12 deadline for the Trump administration to report on what has been done “post haste” to fix the conditions.

The order forces the government to allow the facilities to be inspected by public health professionals and staffed by medical professionals. It involves all of U.S. Customs and Border Protection’s facilities in Texas’ El Paso and Rio Grande Valley sectors, which are the subjects of a lawsuit reacting to reports of unsanitary conditions at the detention centers.

A group of lawyers filed a June 26 temporary restraining order with Gee to hold the Trump administration in contempt. The filing is related to the Flores settlement, a 1997 agreement that details child welfare standards in detention.

“Children are held for weeks in deplorable conditions, without access to soap, clean water, showers, clean clothing, toilets, toothbrushes, adequate nutrition or adequate sleep,” the court filing stated. “The children, including infants and expectant mothers, are dirty, cold, hungry and sleep-deprived.”

A CBP official declined to comment to HuffPost after the Friday ruling, citing pending litigation.

Gee’s emergency order comes in the midst of nationwide concern about the inhumane conditions in Border Patrol facilities, which some experts have said qualify as concentration camps. Government officials have previously argued that they’re responding as best they can given the surge in new arrivals at the U.S.-Mexico border.A record number of children and families are crossing the border, and some facilities have temporarily shut down or quarantined children because of sickness.

Five migrant children have died in Border Patrol custody since December, and a sixth was recently discovered to have died in September.

The lawyers who filed the lawsuit against the Trump administration did so after interviewing dozens of minors at the facilities mentioned in the court filing. The children described being hungry, cold, sick, having to take care of detained infants, and not being allowed to bathe or brush their teeth.

“The declarations paint a picture of wanton disregard for the safety and welfare of children in their care,” said Hope Frye, an immigration lawyer who spoke with the children. “There is complicity across Customs and Border Protection in the systematic persecution of children and the cruel and inhuman circumstances in which they are kept.”

In her order, Gee said the court has dealt with previous Flores settlement violations by the government, the Times reported. The “emergent” nature of the lawyers’ reports “demands immediate action,” she reportedly said.

“The Court has already issued several orders that have set forth in detail what it considers to be violations of the Flores Agreement,” Gee wrote, according to CNN. “Thus, the parties need not use divining tools to extrapolate from those orders what does or does not constitute non-compliance. The Court has made that clear beyond peradventure.”