BOSTON, Jan 17 (Reuters) - A Massachusetts prisoner suffering from gender identity disorder should be provided a sex-change operation paid for by the state's prison system, a federal appeals court said on Friday in a first-of-its-kind ruling.

A panel of three judges of the U.S. First Circuit Court of Appeals in Boston said it agreed with a lower court ruling in 2012 that the Massachusetts Department of Corrections was obligated to provide the surgery as treatment for the inmate, who is serving a life sentence for murder.

"Having carefully considered the relevant law and the extensive factual record, we affirm the judgment of the district court," Judge Rogeriee Thompson wrote for the court.

The inmate, who legally changed his name to Michelle Kosilek from Robert Kosilek, sued the Department of Corrections more than a decade ago trying to force it to pay for gender reassignment surgery.

Kosilek, now in his early 60s, was convicted in 1992 of murdering his wife, a counselor he had met while he was in drug rehabilitation, after she caught him wearing her clothes.

U.S. District Court Judge Mark Wolf in Boston ruled in 2012 that the state had violated Kosilek's rights by denying the procedure, noting that Corrections Department medical personnel had recommended it as necessary treatment for his gender-identity disorder.

The Department of Corrections challenged the decision, claiming that denying sex-change surgery does not constitute inadequate medical care.

"This decision will have repercussions around the country, as other courts weigh the rights of transgender individuals to access medical care," said Neal Minaham, a partner at law firm McDermott Will & Emory who represents, pro bono, individuals in transgender and other rights cases. (Reporting by Richard Valdmanis; Editing by Leslie Adler and Steve Orlofsky)