Transgender Americans have seen slow but steady progress in health insurance coverage for sex reassignment surgery. Unless they’re in prison.

That could change soon thanks to the Transgender Law Center and former California inmate Michelle Norsworthy, a transgender woman who was released from a 28-year prison term last year.

On Tuesday, Norsworthy settled a longstanding dispute with the California Department of Corrections and Rehabilitation (CDCR), leaving in place an April 2015 federal district court ruling that ordered the state to cover her sex reassignment surgery (SRS). As part of the settlement deal, the state of California will drop its request to vacate that ruling.

“This is a long-awaited victory for Michelle and ensures her case will continue to stand as a critical legal precedent,” said Flor Bermudez, Detention Project Director at the Transgender Law Center (TLC), which represented Norsworthy. “It’s clear: prisons have a legal constitutional obligation not to deny the medical needs or humanity of transgender people just because of who they are.”

Last year, Norsworthy was set to become the first prisoner in the country to receive SRS by court order but the CDCR appealed the district court ruling, arguing that counseling and hormone therapy were sufficient. She was then paroled in the middle of the ensuing legal battle.

In the district court ruling, Judge Jon Tigar wrote that SRS was “the only adequate medical treatment for [Norsworthy’s] gender dysphoria.” He also determined that the CDCR denying her this treatment constituted “cruel and unusual punishment” and was therefore unconstitutional under the Eighth Amendment.

By taking the settlement following her release, Norsworthy effectively keeps this legal reasoning in place for other transgender prisoners to cite in the future. It’s no guarantee of surgery for every trans inmate who needs it, but it’s an important foothold in that fight.

“If the [federal district court] order had been vacated, legal advocates would be able to cite the fact that it had been ordered but it wouldn’t still be an order,” Bermudez told The Daily Beast.

In this emerging legal area, that distinction is everything.

The precedent of providing surgery for transgender inmates has been elusive, even though major medical associations recognize SRS as a medically necessary treatment for gender dysphoria. Transgender prisoners came close to breaking through the surgical barrier in 2012 after a federal court judge ordered the state of Massachusetts to grant SRS to inmate Michelle Kosilek.

But that ruling was overturned and, last May, the Supreme Court declined to hear Kosilek’s appeal. Norsworthy then became the next best hope.

Her success in obtaining the April 2015 district court order was bolstered by another settlement the TLC reached with the CDCR last August in the case of transgender prisoner Shiloh Quine. As part of that deal, the CDCR agreed to move Quine into a women’s facility, provide surgery for her, and revise its policy for other trans inmates.This made California the first state in history to agree to cover medically necessary SRS for prisoners.

“After so many years of almost giving up on myself, I will finally be liberated from the prison within a prison I felt trapped in, and feel whole, both as a woman and as a human being,” said Quine after the settlement was reached.

Opponents of surgery for transgender inmates often cite the supposedly exorbitant cost of the procedure, or the crimes of the prisoners, to make a case against it.

For instance, a spokesperson for California Correctional Health Care Services claimed last April that Norsworthy’s SRS could cost as much as $100,000—a figure that was repeated uncritically in the Los Angeles Times. In the United States, the total cost of SRS for transgender women is typically around $20,000.

The small size of the transgender population also means that surgical coverage would likely cost taxpayers next to nothing. In Oregon, for example, Medicaid-covered transgender health care for all residents—not just prisoners—has been estimated to cost the state less than $150,000 per year out of an $18 billion health plan budget.

When conservative outlets like Breitbart clamor about surgery for transgender inmates like Norsworthy being performed “at state expense,” they generally do not note how miniscule these expenses actually are.

Still more noise is made about the fact that all three of these women—Norsworthy, Quine, and Kosilek—were imprisoned for murder.

Tabloid headlines like “Convicted murderer can have £67,000 sex-change operation paid for by the state”—and even mainstream media headlines like ABC’s “Federal Judge Approves Sex Change for Convicted Murderer”—present their crimes as potentially disqualifying factors for receiving state funding for SRS.

But the outrage these headlines are intended to stoke rests on the assumption that SRS is an elective procedure, not one that can be medically necessary. That’s an assumption that goes against current medical consensus.

As the American Medical Association (AMA) noted as early as 2008, “An established body of medical research demonstrates the effectiveness and medical necessity of mental health care, hormone therapy, and sex reassignment surgery as forms of therapeutic treatment for many people diagnosed with GID [gender identity disorder].”

Eight years after this AMA resolution, SRS is still frequently presented as an elective procedure performed at great taxpayer expense, especially when prisoners are involved. “Prisoner Receives Life-Saving Medical Treatment” just doesn’t have the same force, it seems.Outside of prisons, the United States is inching toward more trans-inclusive health insurance coverage. Most public and private health insurance plans, as the National Center for Transgender Equality (NCTE) notes, still exclude some or all forms of transition-related health care. But 11 states now explicitly ban transgender exclusions for both private insurers and Medicaid.Federal changes have been implemented as well. In 2014, Medicare removed a national exclusion on transition-related surgeries. And last September, a ruling from the Department of Health and Human Services opened the door for transgender people to file Title VII discrimination complaints against insurers.

But inside prisons, transgender people—especially trans women—face even more obstacles in accessing health care. Many do so while being held in facilities that do not match their gender and enduring staggering amounts of sexual violence. Norsworthy, for example, was housed in a men’s facility even though she has been receiving hormone therapy since 1999.

“What the state of California did to me was not right,” she said. “I was denied medical care, experienced repeated and brutal sexual assault, and suffered the daily rejection of my basic humanity and identity for 30 years.”

In a UC Irvine study, fifty-nine percent of female transgender inmates in California reported having experienced sexual assault in prison, compared to just over 4 percent of randomly selected inmates in men’s prisons.

Most correctional departments will not house transgender women in women’s facilities unless they have had SRS. In other words, decisions are made based on genitals, not gender. By denying surgery to those who request it, correctional departments essentially force trans women to remain in facilities where they are at high risk of sexual assault.

Norsworthy served her entire term in a men’s prison and never succeeded in receiving the surgery she needed from the CDCR. But in the end, her legal agitation could have longstanding consequences for transgender prisoners across the U.S.

“This settlement is a message that transgender people’s medical needs are real and cannot be dismissed by the state just because of who we are,” she said. “Even though I have been released, this settlement means that there is an undisputed legal precedent out there for all of the transgender people still suffering in prison today.”