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.