California, which hasn’t been all that kind to transgender prison inmates, became the first state in the nation this week to adopt a policy on sex-reassignment surgery for them.

The guidelines were released this week by Clark Kelso, the court-appointed receiver who oversees the prisons through the California Correctional Health Care Services (CCHCS). They come just months after the state approved, for the first time, a legal settlement to provide medical care and surgery for Shiloh Heavenly Quine, while denying it to another inmate, Michelle-Lael Norsworthy.

Around 400 California prisoners, out of 125,000, are being treated for gender dysphoria, a condition in which a person's psychological identity is the opposite of their biological sex. Many of them are receiving hormone therapy. Not all of them will automatically qualify for gender reassignment surgery.

The guidelines require that an inmate consistently, and insistently, ask for the surgery. Inmates are only eligible if they can expect to spend at least two more years in prison and have lived as a member of that sex for a year while taking hormone therapy.

Once an inmate's doctor certifies that the patient is sufficiently stressed out over their condition, a panel of health professionals will review an application for surgery.

Joyce Hayhoe, CCHCS director of legislation and communications, told the New York Times that criteria for being approved for surgery are “pretty conservative. The inmate doesn’t just request surgery and then get it.”

The policy was drafted by the CCHCS and the California Department of Corrections and Rehabilitation (CDCR). Kelso and the CCHCS have been in charge of prison health care since 2002, when the federal courts decided that hideous overcrowding, significant underfunding, gross neglect and brutish policies had created a systemic health crisis that was not being addressed.

The surgery can cost up to $100,000, but reportedly can be as low as $15,000. The policy covers removal and reconstruction of genitals and mastectomies, but does not include cosmetic changes like breast implants.

Kris Hayashi, executive director of Transgender Law Center, lauded the state's new policy. “California has set a model for the rest of the country and ensured transgender people in prison can access life-saving care when they need it,” she told Reuters.

The state has agreed to house Shiloh Quine, who was born male, in a women's prison after surgery and said it will do the same for others. Inmates born female would have the option of transferring to a men's prison after surgery.