A three-judge panel of the U.S. Ninth Circuit Court of Appeals has ordered the Idaho Department of Corrections to provide gender reassignment surgery to a transgender inmate.

The court said that denying the procedure when it is medically necessary violates the 8th Amendment of the U.S. Constitution.

“We hold that where, as here, the record shows that the medically necessary treatment for a prisoner’s gender dysphoria is gender confirmation surgery, and responsible prison officials deny such treatment with full awareness of the prisoner’s suffering, those officials violate the Eighth Amendment’s prohibition on cruel and unusual punishment,” the ruling states.

Adree Edmo testified that in 2015 she attempted to castrate herself using a disposable razor blade. She removed one testicle during a second attempt in 2016. The testicle was repaired at a nearby hospital.

Last year, U.S. District Judge B. Lynn Winmill sided with Edmo and ordered Idaho to provide the surgery. Friday's order upholds Winmill's ruling.

Edmo is represented by the National Center for Lesbian Rights (NCLR).

“One of the foundational principles of our Constitution is that the State cannot subject people in its custody to cruel and unusual punishment, including by failing to treat serious medical conditions,” NCLR Senior Staff Attorney Amy Whelan said in a statement. “This ruling is in line not only with long-standing medical evidence, but also with legal rulings across the country that it is dangerous and unconstitutional to deny transgender people access to medically necessary care in prison.”

Prison officials have not said whether they will appeal the ruling.