The state's federal appeals court reinstated the lawsuit brought by Ophelia Azriel De'lonta, who says the state's refusal to pay for the surgery was cruel and unusual punishment barred by the Eighth Amendment.

De'lonta, born Michael Stokes, claims she has a constant urge to castrate herself and needs to have the surgery to avoid self-mutilation, according to Reuters.

As both Reuters and The Wall Street Journal's Law Blog point out, the Fourth Circuit Court of Appeals did not order the state of Virginia to pay for De'lonta's surgery. The court only said she can fight her case in district court based on the Eighth Amendment.

The Virginia court's still ruling signals a historic change. It's the second case in six months where a court recognized that sex-change surgery could be medically necessary for transgender inmates.