SACRAMENTO (AP) — A federal judge has outlined a plan for California to end nearly a decade of federal control over its prison health care system.

U.S. District Court Judge Thelton Henderson of San Francisco acted Tuesday after a court-appointed overseer reported that conditions have substantially improved since 2006.

READ MORE: Man To Be Extradited To Long Beach To Face Murder Charges In Killings Of 2 Over Parking

Henderson said each of the state’s 34 prisons must pass an inspection before they can be returned to state control. The inspections are underway and are expected to take more than a year.

READ MORE: Woman Says She Was Refused Service At An Encino Dunkin' Donuts For Being Deaf

The state has spent $2 billion for new prison medical facilities, doubled its annual prison health care budget and reduced its prison population by more than 40,000 inmates in the last decade.

Henderson had said the conditions were so poor that they violated inmates’ constitutional rights against cruel and unusual punishment.

MORE NEWS: Illegal Marijuana Grow Bust Nets Nearly 30,000 Plants And Leads To 31 Arrests In San Bernardino

(© Copyright 2015 The Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten or redistributed.)