A federal judge in Los Angeles has ordered the Trump administration to seek consent before administering psychotropic drugs to immigrant children held in a facility in Texas.

U.S. District Judge Dolly M. Gee ruled that the government was in violation of a court decree dating to the mid-1980’s known as the Flores settlement which governs the treatment of detained immigrant children. There are more than 10,000 minors in federal custody. The vast majority of them arrived at the southern border unaccompanied from Central America long before the current controversy over separated families created by the Trump administration’s zero-tolerance immigration policy. The settlement required the government to hold youths in the least restrictive setting possible.

Lawyers argued that the children at the Shiloh Residential Treatment Center in Manvel, Texas, were administered powerful psychotropic drugs without any explanation to them. Such drugs are used to treat a range of conditions from schizophrenia to depression. In some cases, children allegedly were told that if they didn’t take the drugs their detention periods would be prolonged.

Judge Gee says the government must get parental consent or a court order before giving children psychotropic drugs, unless it is an emergency. The judge also ordered the government to explain to the children in writing why they are being detained. She also ruled that the government cannot detain a minor only for “reported gang involvement.”

In addition, Gee ordered that all youths covered under the Flores ruling be removed from the Shiloh Residential Treatment Center unless a licensed psychologist or psychiatrist determines that a minor poses a risk to himself or others.

The judge’s ruling follows another decision issued Friday in which she said she would appoint an independent monitor to oversee the facilities where immigrant children are detained.

A spokesman for the Justice Department declined comment on Gee’s ruling.

Copyright 2018 NPR. To see more, visit http://www.npr.org/.