(Reuters) - The Trump administration has rolled back protections for transgender prison inmates introduced under former President Barack Obama after some prisoners challenged the policies in court.

FILE PHOTO: A Cook County Sheriff's police car patrols the exterior of the Cook County Jail in Chicago, Illinois, January 12, 2016. REUTERS/Jim Young

An inmate’s biological sex will now be used to make the initial decision as to where transgender prisoners are housed, instead of the gender to which they identify, according to a change in guidelines announced on Friday by the U.S. Bureau of Prisons.

The move, decried by transgender rights advocates, comes after four women held at a Texas detention center filed a federal lawsuit. The inmates argued that the previous prison guidelines, introduced in January 2017 just days before Obama left office, put them at greater risk of rape because they might have to share facilities with transgender women.

Under President Donald Trump, the Justice Department said in August that it would evaluate the issues in the lawsuit.

Following Friday’s change to the guidelines, first reported by BuzzFeed News, prison authorities are instructed to consider the health and safety of transgender inmates, as well as “whether placement would threaten the management and security of the institution and/or pose a risk to other inmates in the institution.”

Bureau of Prisons officials did not immediately respond to requests for comment on Saturday. But Nancy Ayers, a spokeswoman for the agency, told BuzzFeed News that the new policy takes into account the needs of all federal prisoners “and articulates the balance of safety needs of transgender inmates as well as other inmates.”

The move was condemned by transgender activists, who point to official statistics that show transgender inmates are at disproportionate risk of suffering sexual violence.

“The decision to disregard a transgender person’s gender identity is harmful and disrespectful,” David Stacy, government affairs director of the Human Rights Campaign, a lesbian, gay, bisexual and transgender advocacy group, said in a statement.

The Trump administration has sought to ban transgender people from serving in the U.S. military and has taken other steps aimed at rolling back transgender rights.

In October, the administration said a federal law banning gender-based workplace discrimination does not protect transgender employees, reversing another Obama-era position.

In February, Trump rescinded Obama administration guidance that said public schools should let transgender students use the restroom corresponding to their gender identity.