SACRAMENTO, Calif. (AP) - California prison officials are setting the first standards for which transgender inmates should receive state-funded sex-reassignment surgery after spending years in court fighting to block the operations.

In a policy that took effect Tuesday and was reviewed by The Associated Press, prison mental health professionals would refer the inmates for the surgery. To qualify for the surgery, inmates must be diagnosed with what is formally known as gender dysphoria; have expressed a desire for sex-reassignment surgery for at least two years; and have lived as a member of the preferred gender for at least 12 months.

The announcement comes after California became the first state to agree to pay for one inmate's surgery and refused to provide the surgery to a second inmate who has since been paroled.

The guidelines are believed to be the first in the nation by a prison system, said Joyce Hayhoe, a spokeswoman for the federal court-appointed official who controls California's prison medical care. They were developed in cooperation with the California Department of Corrections and Rehabilitation, which oversees inmates' mental health care.

"We understood there needed to be some uniform protocols in place that focused on the need for surgery when it was medically necessary, when there weren't any alternatives that were feasible," she said. The standards are similar to those used by medical providers outside the prison system, she said.

The eight-page document calls for inmates who request the surgery and meet the basic criteria to be referred for evaluation to a committee of two medical doctors, two psychiatrists and two psychologists, which would make a recommendation to another higher-level committee of medical professionals.

The policy prohibits procedures which are considered merely cosmetic, including hair removal, face lifts, breast augmentations or other implants, which Hayhoe said will help hold down the cost to taxpayers. She previously estimated the cost could near $100,000, though the Transgender Law Center in Oakland, which has represented several inmates, said that is exaggerated.

There are currently 375 males and 26 females in the prison system receiving hormone therapy that gives them the characteristics of the opposite sex. They are housed in prisons based on their birth gender unless they have surgery, with many in special protective housing or in mental health facilities.

Hayhoe said she does not expect a flood of applications or approvals for the surgery because many won't seek it or won't qualify under guidelines that she described as conservative.

Jody L. Herman, a scholar of public policy who focuses on gender identity and transgender people at The Williams Institute, a think-tank on LGBT issues at the University of California, Los Angeles, said the best national survey found that about 42 percent of respondents had any surgery, including some of the procedures the department defines as cosmetic.

One of the new guidelines is that the inmate must have at least two years left in prison.

That became a factor in the case of Michelle-Lael Norsworthy, who was released from prison one day before a federal appeals court was to hear her request in August for the state prison system to pay for her sex reassignment surgery.

But the same month, the corrections department announced it would pay for the surgery for Shiloh Heavenly Quine, who is serving a life sentence for a Los Angeles County murder. She has not yet had the surgery.

A federal judge in Sacramento is considering the third case, that of inmate Mia Rosati, after the 9th U.S. Circuit Court of Appeals ruled in June that the state may be violating her rights by denying her sex reassignment surgery. She also is serving a life sentence for murder from Los Angeles County.