After a lengthy legal battle, a California transgender woman became the first inmate in the United States to receive a government-funded gender-reassignment surgery.

Convicted murderer Shiloh Quine, who is serving a life sentence for her role in a deadly 1980 incident in Los Angeles, is currently recovering from the surgery, according to the Transgender Law Center, which represented Quine in a federal civil rights lawsuit against California prison officials.

Advocates say it’s a significant step that sets a precedent in recognizing transgender people’s constitutional rights behind bars, particularly on issues of medical treatment. But they also caution that the fight for transgender rights in prisons is far from over.

“The work is in no way finished,” attorney Flor Bermudez, detention project director for the Transgender Law Center, told The Washington Post.

While Quine’s case led to the creation of transgender-friendly policies in California prisons, implementing those policies in a way that benefits transgender inmates is another matter, Bermudez said. Quine’s success also makes her a minority, as transgender inmates who request gender-reassignment surgeries still often get denied, advocates say.

“Medical needs for trans people are rejected out of hand, or not even treated as medical issues; they’re treated as a political issue,” said Harper Jean Tobin, director of policy for the National Center for Transgender Equality.

In what advocates called a historic settlement, the California Department of Corrections and Rehabilitation agreed in 2015 to pay for Quine’s gender-reassignment surgery and to transfer her to a women’s facility. The agency also agreed to change its policies so that transgender inmates can wear clothes and have commissary items consistent with their gender identity.

“For too long, institutions have ignored doctors and casually dismissed medically necessary and life-saving care for transgender people just because of who they are — with devastating consequences to our community,” Kris Hayashi, executive director for the Northern California-based Transgender Law Center, said in a statement. “With this surgery, the state is fulfilling one part of a landmark settlement that was a victory not only for Shiloh and transgender people in prison, but for all transgender people who have ever been denied the medical care we need.”

A spokeswoman for the California Correctional Health Care Services declined to say where and when Quine had her surgery, citing medical privacy laws. The 57-year-old inmate’s attorneys told the Associated Press that the procedure was performed at a San Francisco hospital.

Quine, currently listed as an inmate at Mule Creek State Prison in Ione, Calif., about 50 miles southeast of Sacramento, is serving a life sentence without parole for murder. She sued prison officials in federal court in 2014 after her requests for surgery and a transfer to a women’s facility were denied. A settlement was reached in August 2015.

Terry Thornton, a spokeswoman for the California Department of Corrections and Rehabilitation, told the AP that the state is constitutionally required to provide inmates, including those who have been diagnosed with gender dysphoria, with “medically necessary treatment for medical and mental health conditions.”

Quine, who was born in Los Angeles and grew up in Northern California and Arizona, has identified as a female since she was 9 and has been taking hormones since adolescence, according to court records. Raised as a man, Quine was married — and divorced — twice and had two daughters with her second wife.

Quine said in court records that she attempted suicide multiple times in the past, once by slitting her wrist and again by attempting to hang herself. In 1978, she said she tried to castrate herself.

While in prison, she was receiving treatment for depression and was diagnosed with gender dysphoria, formerly called gender identity disorder, which manifests in feelings of distress, anxiety and depression. A psychologist who examined her determined her to be a good candidate for gender-reassignment surgery “on the basis of medical necessity,” and that the procedure is “reasonable and necessary to alleviate severe pain,” according to the psychologist’s report.

In an interview with the Transgender Law Center after the 2015 ruling, Quine said allowing her to have the surgery meant she was “getting closer to being comfortable” with herself.

“It shows the world is evolving, and starting to understand different viewpoints and perspectives better than in the past,” she said. “People are learning to recognize the humanity in everybody. It’s been a long time coming.”

But Bermudez, the Transgender Law Center’s detention project director, said that while Quine’s success in court was a step toward the right direction, she has received at least 30 letters from other transgender people who said they’ve been denied surgery.

Liz Gransee, a spokeswoman for the California Correctional Health Care Services, said the state has so far received 64 requests from prisoners for gender-reassignment surgery. Of those requests, two male-to-female and two female-to-male surgery requests have been approved.

Thirteen are still waiting for decisions, while 51 — about 80 percent of the requests — have been denied, Gransee said.

There are 475 transgender inmates in California prisons.

Quine was arrested and charged with robbery, kidnapping and murder in 1980, after she and an accomplice killed 33-year-old Shahid Ali Baig, a father of three, in downtown Los Angeles, the AP reported.

Baig’s daughter, who fought Quine’s request in court, said knowing that taxpayers funded surgery for her father’s killer was “a slap in the face.”

“My dad begged for his life,” Farida Baig told the AP. “It just made me dizzy and sick. I’m helping pay for his surgery; I live in California.”

The cost of Quine’s surgery is unknown.

Gransee, the California Correctional Health Care Services spokeswoman, said she could not discuss an inmate’s health care. But depending on individual circumstances, she said, costs for gender-reassignment surgery could reach up to $100,000, including counseling and other treatments and medications before, during and after a procedure.

The Transgender Law Center, however, said that figure is an overestimation.

Marci Bowers, a transgender obstetrician and gynecologist in California, and Fred Ettner, an Illinois physician who works with people going through the transition, told The Post’s Lenny Bernstein in 2015 that a male-to-female surgery costs between $40,000 and $50,000. A female-to-male procedure costs at least $75,000.

One of the highest-profile cases in California involved a transgender inmate named Michelle-Lael Norsworthy, who was abruptly released from prison in 2015 after a federal judge granted her request for gender-reassignment surgery, the Los Angeles Times reported.

Last year, the U.S. Army agreed to pay for hormone treatments for Chelsea Manning, the former intelligence analyst who was imprisoned in 2013 for leaking government files to WikiLeaks, the AP reported. Manning’s lawyers announced in September that they’d been assured the government will provide gender-reassignment surgery, according to USA Today.

In 2012, a judge ordered Massachusetts to pay for the surgery of an inmate, but that decision was overturned on appeal, the AP reported.

Tobin, of the National Center for Transgender Equality, said she believes there will be more cases in which the government will “resist” paying for gender-reassignment surgeries.

“More courts will have to step in and remind the government of those responsibilities,” Tobin said.