By JACQUES BILLEAUD, Associated Press

PHOENIX (AP) — The state of Arizona lost a key battle Thursday in a settlement over the quality of health care in its prisons when an appeals court ruled that a lower-court judge has the power to order corrections officials to develop a general staffing plan to remedy deficiencies in inmate care.

The ruling by the 9th Circuit Court of Appeals said a federal magistrate judge erred when he concluded the settlement barred the court from ordering a plan to increase staffing.

Lawyers for inmates say one of the biggest barriers in providing adequate health care is not having enough workers at the 10 state-run prisons to tend to the medical needs of inmates.

The 2014 settlement said the court retained the power to enforce the agreement, but also said that the court couldn't order construction of a new prison or the hiring of a specific number or type of staff.

The 9th Circuit now says the court may issue a general staffing order that doesn't require the state to hire a specific number or type of staff to remedy the state's noncompliance with the settlement.

The ruling that was reversed by the appeals court was made U.S. Magistrate Judge David Duncan, who has since retired because of health reasons. U.S. District Judge Roslyn Silver took over the case this summer.

"She can't say hire three pharmacists at this prison and four doctors at this prison, but she can say you need more staff," said Corene Kendrick, an attorney representing the prisoners.

The Department of Corrections said it was reviewing the ruling and had no immediate comment.

This summer, Duncan found Corrections Director Charles Ryan in civil contempt of court and fined the state $1.4 million for failing to follow through on the improvements the state promised to make to inmate care when agreeing to settle the class-action lawsuit.

Silver has recently raised the possibility of throwing out the four-year agreement and resuming litigation over inmate care because of the state's pervasive noncompliance.

The 2012 lawsuit alleged that Arizona's 10 state-run prisons didn't meet the basic requirements for providing adequate medical and mental health care. It said some prisoners complained that their cancer went undetected or that they were told to pray to be cured after begging for treatment.

It also alleged that the failure of the medical staff at one prison to diagnose an inmate's metastasized cancer resulted in his liver enlarging so much that his stomach swelled to the size of a pregnant woman at full term. Another inmate who had a history of prostate cancer had to wait more than two years for a biopsy.

The state denied allegations that it was providing inadequate care, and the lawsuit was settled in October 2014 without the state acknowledging any wrongdoing.

Gov. Doug Ducey expressed confidence in his corrections director after he was found to be in contempt of court. Ducey has said he wants state agency directors, not judges, running their departments.

___

Follow Jacques Billeaud at twitter.com/jacquesbilleaud