The U.S. Court of Appeals for the Ninth Circuit on Thursday ruled against the Trump administration over living conditions for detained migrant children, upholding a district court order that found federal authorities had violated the terms of a decades-old settlement dictating the treatment of the children.

Circuit Judge Marsha Berzon was pointed in the court’s opinion, finding the federal government incorrectly claimed that Central District of California Judge Dolly Gee’s June 2017 order modified the terms of the 1997 Flores settlement.

“Assuring that children eat enough edible food, drink clean water, are housed in hygienic facilities with sanitary bathrooms, have soap and toothpaste, and are not sleep-deprived are without doubt essential to the children’s safety,” Berzon wrote.

“The district court properly construed the agreement as requiring such conditions rather than allowing the government to decide whether to provide them.”

Berzon pointed to the federal government’s claim that by interpreting the settlement “to require that Border Patrol stations provide the most basic human necessities—accommodations that allow for adequate sleep, essential hygiene items, and adequate, clean food and water—the district court modified the agreement’s requirement that minors be held in “safe and sanitary” conditions that comport with the “special concern for the particular vulnerability of minors.”

“We emphatically disagree,” Berzon wrote, adding that a “cramped” interpretation of the settlement’s terms is “untenable.”

Berzon was joined by Senior Judge A. Wallace Tashima and Judge William Fletcher.

The case stemmed from allegations that the U.S. was in violation of the settlement over the treatment of migrant children detained at the U.S.’ southern border.

The terms of the 1997 agreement spell out how migrant children detained by the federal government must be treated, including that the children must be held “in facilities that are safe and sanitary” and that the minors be treated “with dignity, respect, and special concern for their particular vulnerability as minors.”

Gee had previously ruled that the federal government was in violation of the Flores settlement by keeping the minors in unsanitary and unsafe conditions at the U.S.-Mexico border.

Justice Department attorneys argued before the circuit panel in June that the terms of the settlement didn’t require them to provide specific sanitary items.

A suggestion by DOJ lawyer Sarah Fabian during oral arguments that the government didn’t have to give the children soap or toothbrushes captured national headlines.

“It’s within everybody’s common understanding that if you don’t have a toothbrush, if you don’t have soap, if you don’t have a blanket, that’s not safe and sanitary. Wouldn’t everybody agree to that?” Tashima asked Fabian. “Do you agree with that?”

“Well, I think it’s, I think those are—there’s fair reason to find that those things may be part of safe and sanitary,” Fabian replied.

“Not ‘may be.’ ‘Are’ a part,” Tashima said. “Why do you say, ‘may be’? You mean there’s circumstances when a person doesn’t need to have a toothbrush, toothpaste and soap for days?”

The Trump administration has faced intense scrutiny over its treatment of migrant children detained at the border, particularly in light of its since-terminated policy of separating immigrant families at the border.

At least six children have died in or shortly after being held in the custody of immigration officials over the past year.

Read the ruling:

Read more: