A Massachusetts federal appeals court has upheld a lower court's ruling ordering the state to provide gender reassignment surgery to a transgender inmate.

Michelle Kosilek sued the state's Department of Correction for not providing the surgery.

In a 2-1 ruling handed down Friday, the First Circuit Court of Appeals in Boston found that the surgery is necessary and that the state violated Kosilek's constitutional rights by refusing to provide her with the surgery, The Boston Globe reported.

“In sum, where at least three eminently qualified doctors testify without objection, in accord with widely accepted, published standards, that Kosilek suffers from a life-threatening disorder that renders surgery medically necessary, and the factfinder is convinced by that testimony, we are at a loss to see how this court can properly overrule that finding of fact,” the 3-judge panel wrote in its 80-page ruling.

Jenifer Levi, director of GLAD's Transgender Rights Project, welcomed the ruling.

“If she needed treatment for cancer or heart disease, this case would never have wound up in court,” Levi said in a statement. “If we are to call ourselves a civilized society, there is a baseline of care that has to be provided to all prisoners, including prisoners who are transgender. We hope that Michelle will now get the treatment that she desperately needs.”

The state argued that Kosilek had received proper treatment while in prison, including female hormones, laser hair removal and psychotherapy.

Born Robert, Michelle Kosilek, 64, is serving a life sentence at an all-male prison in Norfolk for the 1990 murder of her wife Cheryl.

While in prison, Kosilek has twice attempted to take her own life. She also attempted to castrate herself.

The state has not said whether it will appeal the ruling to the full court.