Michelle-Lael Norsworthy has been in prison for 28 years. But she only needed to stay there a few more months to establish one of the more elusive precedents in LGBT history.

Norsworthy, 51, is transgender and began her transition from male to female in the 1990s while serving a sentence for second-degree murder in a California state prison. In April, a landmark ruling from a Northern California district court judge ordered the state to cover Norsworthy’s sex reassignment surgery (SRS), which was deemed “the only adequate medical treatment for her gender dysphoria.”

Norsworthy’s surgery is now set for July 1 and if it takes place, it would mark the first time a transgender inmate in the United States receives the procedure by court order. But last week, Norsworthy was recommended for parole and she may be set free before it can take place. It’s a complex race against the clock with a great deal of litigation on the line.

Following the April ruling, the California Department of Corrections and Rehabilitation (CDCR) appealed the decision on the grounds that it has already provided Norsworthy with counseling and hormone therapy, effectively delaying the procedure. The officials further claimed that Norsworthy had been intentionally delaying her parole hearing to remain in prison until her surgery date. As the Associated Press reports, her parole hearing had been put off four times in the last six months.

Attorneys from The Transgender Law Center (TLC), on the other hand, contended that the parole hearing delays were not her fault, noting that she will be able to receive sex reassignment surgery under California’s Medi-Cal program if she is released. On the same day as Norsworthy’s parole recommendation, however, an appellate panel put a stay on the April district court ruling and scheduled a hearing for August, by which time Norsworthy may well be released.

“We are thrilled that Michelle’s parole hearing was successful, and that she might soon be able to live her life freely as a woman,” TLC legal director Ilona Turner said in a statement to the AP. “Being housed with men, sexually assaulted, and denied critical health care these past 30 years, Michelle has suffered greatly in prison and continues to suffer every day she is denied the surgery she desperately and urgently needs.”

The CDCR insists that the pending litigation had no bearing on the parole panel’s decision. CDCR spokesperson Luis Patino told Reuters, “They work independently and do not take anything else into consideration.”

Norsworthy’s parole recommendation now faces a review from the state Board of Parole Hearings that could take up to five months. In the meantime, if the appeals court ultimately overturns the district court judge’s April decision, the CDCR would narrowly dodge the establishment of precedent for covering transition-related surgeries for transgender inmates. Although the district court judge has argued that his decision was specific to Norsworthy’s case, it would almost certainly be cited in similar claims on behalf of transgender inmates if it is not overturned.

Norsworthy’s request for SRS also comes on the heels of a similar potentially historic ruling in Massachusetts, which was ultimately overturned. Norsworthy, who has been receiving female hormones since 1999, only began requesting SRS in 2012 after learning that a federal court judge had ordered the state of Massachusetts to grant the procedure to transgender inmate Michelle Kosilek. That ruling was overturned on appeal and, this month, the U.S. Supreme Court declined to hear Kosilek’s last appeal. Unlike Norsworthy, however, Kosilek is serving a life sentence for first-degree murder without the possibility of parole.

AS NPR reported last year, Kosilek was poised to become the first inmate to receive the surgery by court order but now that the Supreme Court has denied her appeal, Norsworthy’s case is next in line.

At stake for many transgender inmates in these decisions is that transgender people who have not undergone sexual reassignment surgery—including Norsworthy—are generally placed in prisons that correspond with the gender they were assigned at birth, even if they have undergone hormone therapy. Emerging data suggests that transgender women are especially endangered by this practice—one study from the Transgender, Gender Variant and Intersex Justice Project (TGI) found that 59 percent of transgender women in California reported having experienced sexual assault in prison compared to just 4 percent of other inmates in men’s prisons.

State officials who argue against granting transgender inmates SRS typically cite the procedure’s substantial cost and its potential impact on taxpayers. In Norsworthy’s case, a spokesperson for California Corrections Health Care services said the procedure could cost as much as $100,000, but the Transgender Law Center has argued that this estimate is too high. The Philadelphia Center for Transgender Surgery, for example, offers SRS for transgender women for an estimated $19,150, including fees.

State attorneys have also argued that Norsworthy’s physicians have not deemed SRS to be a medical necessity in her case but the Transgender Law Center contends that the procedure “may be lifesaving for those who need it.” A 2012 position statement from the American Psychiatric Association notes, “Significant and long-standing medical and psychiatric literature exists that demonstrates clear benefits for medical and surgical interventions to assist gender variant individuals seeking transition.”

The World Professional Association for Transgender Health (WPATH) has also issued a general statement including SRS in a list of procedures that may be “medically necessary” in the treatment of gender dysphoria.

Outside of the correctional system, a federal court ruled in March that the Affordable Care Act makes it illegal to discriminate against patients based on their gender identity, a decision that could pave the way for more reliable coverage of SRS from insurers.

But inside prisons, transgender inmates seeking SRS are still waiting for a breakthrough case like Norsworthy’s to be upheld. Norsworthy herself may walk free before the end of the year and receive SRS through Medi-Cal. In the meantime, transgender inmates with time left on their sentence still face significant resistance from U.S. correctional departments, with surgery remaining just out of reach.