Depriving a transgender inmate with severe gender dysphoria of sex reassignment surgery is a form of “cruel and unusual punishment,” a federal appeals court ruled Friday, affirming a lower court ruling.

The 9th U.S. Circuit Court of Appeals ordered the state of Idaho to provide the surgery for trans inmate Adree Edmo. The ruling is the first time an appeals court has ordered a state to provide gender-affirming surgery to a prisoner, and the decision is at odds with a ruling issued earlier this year by the 5th U.S. Circuit Court of Appeals.

Idaho's Republican governor, Brad Little, vowed to appeal the decision to the U.S. Supreme Court.

Adree Edmo. Idaho Department of Correction / via AP

Edmo, who was featured in the Boise State Public Radio podcast “Locked,” repeatedly inflicted self-harm and twice attempted to castrate herself with a razor blade, according to court documents.

“Responsible prison authorities were deliberately indifferent to Edmo’s gender dysphoria, in violation of the Eighth Amendment,” the 9th Circuit ruling stated, adding it was established that "Edmo had a serious medical need, that the appropriate medical treatment was GCS [gender confirmation surgery], and that prison authorities had not provided that treatment despite full knowledge of Edmo’s ongoing and extreme suffering and medical needs.”

Idaho's governor decried the ruling as “extremely disappointing” and said the state "cannot divert critical public dollars away from the higher priorities of keeping the public safe and rehabilitating offenders."

Amy Whelan, a senior staff attorney at the National Center for Lesbian Rights, called Little's promise to appeal the case to the high court a “very disappointing and reprehensible reaction by the state.”

Whelan, one of the attorneys representing Edmo, added that the NCLR took the case because of its focus on the most marginalized of the LGBTQ community and because “medical care is essential for transgender people.”

Whelan called Edmo’s case “very, very severe gender dysphoria,” as evidenced by her repeated attempts to take surgical action on her own body.

“There are decades of Eighth Amendment precedent by the U.S. Supreme Court, where the court repeatedly has found that when you’re assessing whether prison officials are deliberately indifferent — which is the legal standard — with regard to the provision of medical care in prison, that you look to the consensus of the medical community,” Whelan explained.

“There is an extremely robust medical consensus by both the medical and mental health communities that these procedures are part of the standard of care," she said of gender confirmation surgery for patients diagnosed with severe gender dysphoria," adding that "foreseeable pain and suffering will result if people do not receive the care that they need."

Whelan said, absent a stay on the ruling, other courts in the 9th Circuit — which includes Hawaii, Alaska, California, Oregon, Washington, Idaho, Montana, Nevada and Arizona — will likely follow the appeals court ruling for similar cases that may arise.

The 5th Circuit — which covers Texas, Louisiana and Mississippi — ruled in March 2019 that "A state does not inflict cruel and unusual punishment by declining to provide sex reassignment surgery to a transgender inmate."

Follow NBC Out on Twitter, Facebook & Instagram