BOSTON (AP) — A federal appeals court has upheld a judge’s ruling granting a taxpayer-funded sex change operation for a Massachusetts transgender inmate serving a life sentence for murder.

Michelle Kosilek was born male but has received hormone treatments and lives as a woman in an all-male prison. Kosilek was named Robert when convicted of killing his wife in 1990.

READ MORE: Survey Identifies Massachusetts City With The Rudest Drivers

Kosilek sued the state Department of Correction after prison officials refused to grant her request for sex reassignment surgery. A federal judge ruled in 2012 the surgery is the “only adequate treatment” for Kosilek’s gender identity disorder.

READ MORE: Johnson & Johnson Says Its Booster Shot 94% Effective Against COVID-19

Prison officials appealed the ruling to the 1st U.S. Circuit Court of Appeals. The court ruled Friday the 64-year-old Kosilek is entitled to the surgery.

Prison officials argued there are legitimate safety concerns over protecting her in prison if she has the surgery.

MORE NEWS: 'It Looked Like Niagara Falls,' Massive Water Main Break Floods Part Of Beacon Hill

Copyright 2014 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.