On March 30, Passion Star, a transgender inmate being held in male prison facilities, won a years-long legal battle with the Texas Department of Criminal Justice. After several complaints against other inmates and prison guards of continued rape, harassment, and assault, TDCJ announced it would place Star (whose legal name is Zollicoffer) into a “safekeeping” unit, as requested by an emergency motion filed in early March that’s meant to protect Star from more harm.

The latest, successful motion was preceded by other complaints by Star. A previous lawsuit against sixteen defendants filed in late 2014 by Lambda Legal, the national equal rights organization that took on Star’s case, lists several instances of rape and assault by other inmates and details how Star says guards in her prison unit failed to protect her and would sometimes punish her for refusing to leave her cell out of fear for her safety.

From the 2014 lawsuit:

The defendants have repeatedly refused to place Ms. Star in a secure housing placement, known as “safekeeping” or take other reasonable steps to reduce the acts and threats of harm to her. Instead, the defendants have forced Ms. Star to remain in the general population near her aggressors where she has faced documented serious injuries and escalating risks of additional serious harm.

That lawsuit was amended in February 2015 to include new allegations, and the emergency motion made moving Star to safekeeping a priority after she says a gang member told her she’d be murdered if she didn’t stop issuing complaints. TDCJ finally complied and moved Star to safekeeping late last month.

TDCJ’s decision comes at a time when several states around the country are starting to solidify and define their policies on transgender inmates. Star’s legal victory is part of a bigger battle Lambda Legal is fighting to ensure that LGBT inmates are included in the protections set by the Prison Rape Elimination Act, a 2003 Congress-approved act that is meant to keep inmates safe from rape while in prison.

Texas also established its own program, the Safe Prisons Program, in 2003. Under the program, TDCJ created a “safekeeping” category for “offenders identified as being more vulnerable than the average general population offender.” These are nonpunitive, separate housing units that enable inmates to still have access to the same privileges as the general population.

In 2014 the annual Texas Safe Prisons/PREA Plan was updated to be more clear about who, exactly, might be considered “more vulnerable.” Perceived LGBT status makes the list of things that intake officers are told to screen for upon intake to assess risk of sexual victimization. The plan also says a “transgender or intersex offender’s views with respect to his or her own safety shall be given serious consideration” when deciding whether to place an offender into a male or a female unit.

However, this doesn’t mean that transgender offenders get to select which unit they are held in, and it also doesn’t mean transgender offenders are automatically placed in safekeeping units upon arrival. The plan clarifies that requests to be moved to safekeeping have to be considered on a case-by-case basis, and this kind of move usually comes as a result of legal action, as in Star’s case.

So it may have taken years—which some argue is far too long—for Star to be moved from the general prison population and into a safekeeping unit, but the TDCJ decision marks a pretty significant victory for LGBT inmate protections nationwide. Star’s case isn’t unique to Texas. Similar lawsuits were recently filed in New York and Georgia, the latter of which prompted what looks to be the first statement from the Justice Department on how states should treat transgender offenders.