Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

A federal judge on Thursday ordered California's corrections department to provide a transgender inmate with sex change surgery, the first time such an operation has been ordered in the state.

U.S. District Court Judge Jon Tigar in San Francisco ruled that denying sex reassignment surgery to 51-year-old Michelle-Lael Norsworthy violates her constitutional rights. Her birth name is Jeffrey Bryan Norsworthy.

The ruling marks just the second time nationwide that a judge has issued an injunction directing a state prison system to provide the surgery, said Ilona Turner, legal director at the Transgender Law Center in Oakland, which helped represent Norsworthy.

The previous order in a Massachusetts case was overturned last year and is being appealed to the U.S. Supreme Court.

In his ruling in California, Tigar said the surgery has actually been performed just once on an inmate, an apparent reference to a person who castrated himself in Texas then was given the surgery out of necessity.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Norsworthy, who was convicted of murder, has lived as a woman since the 1990s and has what Tigar termed severe gender dysphoria — a condition that occurs when people's gender at birth is contrary to the way they identify themselves.

"The weight of the evidence demonstrates that for Norsworthy, the only adequate medical treatment for her gender dysphoria is SRS," Tigar wrote, referring to sex reassignment surgery.

California Department of Corrections and Rehabilitation officials said they are considering whether to appeal the ruling.

"This decision confirms that it is unlawful to deny essential treatment to transgender people" in or out of prison, said Kris Hayashi, executive director of the Transgender Law Center. "The bottom line is no one should be denied the medical care they need."

If the order stands, Norsworthy would be the first inmate to receive such surgery in California, said Joyce Hayhoe, a spokeswoman for the federal receiver who controls California prison medical care.

Hayhoe said it's not known how much the surgery would cost, but it could run as high as $100,000 depending on the circumstances.

Michelle-Lael Norsworthy. A federal judge on Thursday, April 2, 2015, ordered California’s corrections department to provide the transsexual inmate with sex change surgery, the first time such an operation has been ordered in the state. California Department of Corrections and Rehabilitation via AP

IN-DEPTH

— The Associated Press