FILE - This March 1, 2018 file photo from video provided by the National Asian Pacific American Bar Association (NAPABA) shows U.S. District Judge Dolly Gee in Los Angeles. Gee has ruled that the U.S. government must seek consent before administering psychotropic drugs to immigrant children held at a Texas facility. She issued a ruling Monday, July 30, 2018 that the federal government violated portions of a longstanding settlement governing the treatment of immigrant children caught crossing the border. (NAPABA via AP, File)

FILE - This March 1, 2018 file photo from video provided by the National Asian Pacific American Bar Association (NAPABA) shows U.S. District Judge Dolly Gee in Los Angeles. Gee has ruled that the U.S. government must seek consent before administering psychotropic drugs to immigrant children held at a Texas facility. She issued a ruling Monday, July 30, 2018 that the federal government violated portions of a longstanding settlement governing the treatment of immigrant children caught crossing the border. (NAPABA via AP, File)

LOS ANGELES (AP) — A federal judge ruled Monday that the U.S. government must seek consent before administering psychotropic drugs to immigrant children held at a Texas facility.

U.S. District Judge Dolly M. Gee in Los Angeles issued a ruling that the federal government violated portions of a longstanding settlement governing the treatment of immigrant children caught crossing the border.

Gee said the government must obtain consent or a court order to give children psychotropic medications at a Texas facility under state law unless it’s an emergency.

ADVERTISEMENT

She also said officials must tell children in writing why they are in a secure facility and that gang affiliation alone doesn’t justify such a placement.

“The kids weren’t getting notice of why they were sent away,” said Holly Cooper, co-director of the Immigration Law Clinic at University of California, Davis, and one of the lawyers representing detained immigrant children. “We view this as a victory.”

The decision comes as the Trump administration has toughened policies toward immigrant children and families caught crossing the U.S.-Mexico border. Immigrant rights advocates have fought back against many of the administration’s moves, including separating immigrant parents and children.

The Department of Justice declined to comment on Gee’s ruling.

Immigrant children caught crossing the border alone are placed in government-contracted facilities until they can be released to screened sponsors in the United States or returned to their countries. Most children are placed in non-secure shelters, but in some cases, more secure placements are used.

In her decision, Gee said she agreed with some but not all requests made by the children’s advocates. While some issues relate to the use of psychotropic drugs and the treatment of children at the Shiloh Treatment Center in Texas, the settlement governing detention conditions is overseen by the federal court in Los Angeles.

Immigrant and children’s advocates also have filed a separate lawsuit in an effort to obtain greater oversight over how and when immigrant children are placed and kept in secure facilities, Cooper said.