A Boston federal judge has ordered sex reassignment surgery for a prisoner serving a life sentence without the possibility of parole for murdering his wife.

In a 128-page order on September 4, Chief Judge Mark Wolf of the District of Massachusetts ordered the Massachusetts Department of Correction to provide Michelle Kosilek with the surgery as soon as possible. One of Kosilek’s lawyers believes it to be the first ruling in the nation to order sex reassignment surgery for a prisoner.

Kosilek, a transsexual whose first name was originally Robert, is seeking the only form of treatment that department doctors have deemed adequate to treat his mental illness, severe gender identity disorder.

Wolf noted that since he’s been in prison, Kosilek has tried to kill himself twice and to castrate himself.

“Kosilek has proven…that the [department] Commissioner’s purported security concerns are a pretext to mask the real reason for the decision to deny him sex reassignment surgery — a fear of controversy, criticism, ridicule, and scorn,” Wolf wrote. “Therefore, Kosilek has proven that the [department] is violating his rights under the Eighth Amendment.”

Wolf concluded, “The federal right violated in the instant case is Kosilek’s Eighth Amendment right to the only adequate treatment for his serious medical need, sex reassignment surgery. Therefore, the [Department of Correction] is being ordered to provide Kosilek that treatment. The court finds that there is no less intrusive means to correct the prolonged violation of Kosilek’s Eighth Amendment right to adequate medical care.”

Wolf also ruled that the possibility of reasonable costs and attorney fees is “reserved for future consideration.”

Kosilek murdered his wife, Cheryl McCaul, in 1990 after she expressed anger upon finding Kosilek wearing her clothes. The two met in a drug rehabilitation facility, where McCaul was a volunteer. According to the ruling, she told Kosilek that “a good woman” could cure his transexualism.

In 1992, he was convicted and sentenced to life in prison.

Department of Correction spokeswoman Diane Wiffin said, “We are reviewing the decision and exploring our appellate options.” Department of Correction attorney Richard McFarland represented the department in the case.

In an emailed statement, Frances Cohen, a partner in Bingham McCutchen’s Boston office who represented Kosilek, said she and his other lawyers are “very gratified by this courageous and thoughtful decision by Chief Judge Mark L. Wolf that will permit Ms. Kosilek to receive sexual-reassignment surgery long ago approved for her by the prison medical team.” Cohen, along with Jared Craft, a Boston associate at Bingham, represented Kosilek pro bono.

They were co-counsel with Boston attorney Joseph Sulman of the Law Offices of Joseph Sulman. Sulman said there have been many court rulings regarding treatment for prisoners with gender identity disorder, but he believes this is the first ruling in the country to order sex reassignment surgery: “We’re not surprised by the decision. Once you apply the law to the facts, there’s only one decision you can make.”

Sheri Qualters can be contacted at squalters@alm.com.