A federal judge in California has ruled that the government may not administer psychotropic medication to migrant children in residential centers without first obtaining a court order or consent from a parent or guardian.

The decision relates to a suit alleging that children under the care of the Office of Refugee Resettlement (ORR) were routinely given anti-anxiety and antidepressant drugs, sometimes by force, after being separated from their parents at the southern border.

“Sometimes they give me forced injections,” one child alleged in filings by the Center for Human Rights & Constitutional Law. “One or two staff hold my arms, and the nurse gives me an injection.”

The court ruled that the medicating, forced or not, was in violation of Texas child welfare law, which requires parental consent before providing psychotropic medication unless it is administered in a situation of medical emergency “to prevent the imminent probability of death or substantial bodily harm to the child or others”.

The 1997 Reno v Flores Settlement, which broadly dictates the conditions which the government can hold migrant children, requires that ORR comply with all state laws.

Numerous children testified in affidavits to the forceful or disingenuous medicating. Some reported being told they were being given multivitamins.

“I witnessed staff members forcefully give medication four times,” said one child identified as Isabella, “Two staff members pinned down the girl … and a doctor gave her one or two injections.”

Isabella’s mother said that her daughter has suffered ill-effects from the medications prescribed to her including nausea and trembling and falls. “Nobody asked me for permission to give medications to my daughter, even though the staff has always had my telephone number and address,” Isabella’s mother testified.

The decision by district judge Dolly Gee also ordered that nearly all of the children currently held in the Shiloh residential treatment facility in Texas, where the forced medicatings are alleged to have taken place, must be transferred to less restrictive facilities. Flores requires that children be held in the least restrictive conditions possible and Gee’s ruling agreed with the plaintiffs that Shiloh, a “locked facility with 24-hour surveillance and monitoring,” does not qualify.

Gee, along with fellow California justice Dana Sabraw, has been a persistent force against the administration’s attempts to separate and detain migrant children as part of a zero-tolerance immigration stance. Earlier this month Gee rejected the administration’s request to allow long-term detention of illegal immigrant children, which the Flores settlement expressly forbids. Gee also denied the government’s request to suspend requirements that immigrant children be held only in facilities that meet state child welfare licensing regulations.

In a statement posted to its website Tuesday, the Shiloh treatment center, which is just one of dozens of private facilities the government contracts with for the care of migrant children, denied any wrongdoing but supported the judge’s ruling.

“The allegations specifically about Shiloh have been found to be without merit by multiple regulatory and monitoring bodies,” the statement said. “The judge’s ruling simply upholds what is already the law, and Shiloh agrees. Children should not have to remain in a more secure placement than is necessary, and children should not receive medications without consent.”