BOSTON -

State prison officials must provide taxpayer-funded sex-reassignment surgery to a transgender inmate serving life in prison for murder, because it is the only way to treat her "serious medical need," a federal judge ruled Tuesday.

Michelle Kosilek was born male but has received hormone treatments and now lives as a woman in an all-male prison. Kosilek was named Robert when married to Cheryl Kosilek and was convicted of murdering her in 1990.

--Robert Kosilek's 1990 booking photo

U.S. District Judge Mark Wolf is believed to be the first federal judge to order prison officials to provide sex-reassignment surgery for a transgender inmate.

Kosilek first sued the Massachusetts Department of Correction 12 years ago. Two years later, Wolf ruled that Kosilek was entitled to treatment for gender-identity disorder but stopped short of ordering surgery. Kosilek sued again in 2005, arguing that the surgery is a medical necessity.

In his 126-page ruling Tuesday, Wolf found that surgery is the "only adequate treatment" for Kosilek and that "there is no less intrusive means to correct the prolonged violation of Kosilek's Eighth Amendment right to adequate medical care."

Prison officials have repeatedly cited security risks in the case, saying that allowing Kosilek to have the surgery would make her a target for sexual assaults by other inmates.

But Wolf, who was appointed to the federal bench by President Ronald Reagan in 1985, found that the security concerns are "either pretextual or can be dealt with." He said it would be up to prison officials to decide how and where to house Kosilek after the surgery.