CHICAGO (AP) — Illinois prisons must undergo wide reforms in the treatment of transgender inmates, including training for employees and avoiding cross-gender strip searches, under a court order earlier this month.

The order stems from a 2018 lawsuit filed on behalf of five transgender women who said they weren’t provided with appropriate treatment while in custody.

“This is a sweeping victory for our clients, who have been subject to unspeakable harm by a Department of Corrections that has truly been deliberately indifferent to our clients’ suffering,” said Ghirlandi Guidetti, an American Civil Liberties Union of Illinois attorney who represented the women.

In the lawsuit, the women claimed corrections staff didn’t provide appropriate treatment for gender dysphoria, a medical condition where a person experiences deep discomfort with the gender assigned at birth. They alleged delays in hormone treatment therapy. In one case, an inmate’s treatment was started only after attempts to self-castrate.

Illinois Department of Corrections officials have until Jan. 22 to provide U.S. District Court Judge Nancy Rosenstengel with steps they’ve taken to following the order. Department officials have declined comment, citing pending litigation.

Among other things, the order said prisons can no longer “mechanically” assign housing based on genitalia or physical size and appearance.

(© Copyright 2019 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)