TRACY, Calif. (AP) — California prisons marked a milestone Friday, when officials said they had removed the last of nearly 20,000 beds that had been jammed into gymnasiums and other common areas to house inmates who overflowed traditional prison cells.Inmates in rows of double- and triple-stacked bunk beds became an iconic symbol of the overcrowding crisis, Corrections Secretary Matthew Cate said in announcing an end to the practice."It symbolized, I think, a system that was so crowded it could not work effectively or efficiently," Cate said at Deuel Vocational Institution in Tracy, 70 miles south of the state capital.Crowding was so bad at the California Rehabilitation Center in Riverside County in 2005 that it was hours before guards discovered an inmate had been killed in his bunk in a makeshift dormitory.Since then, federal judges have forced California to radically change the way it houses criminals. The prison population dropped by nearly 19,000 inmates after a new law took effect in October that sends less serious offenders to county jails instead of state prisons.The state currently has nearly 142,000 inmates but must shed another 17,000 inmates to reach the June 2013 court deadline to reduce crowding in its 33 adult prisons. The federal judges ordered the state to reduce its inmate population as a way to improve inmate medical care, which was so inadequate that judges ruled it violated prisoners' constitutional rights.The overflow beds once held more inmates than the entire prison populations of 25 other states, according to national statistics for 2010, the most recent available.The U.S. Supreme Court published two photographs of tattooed, shirtless inmates milling around three-tier bunk beds as part of its ruling last year upholding the authority of lower courts to order California to reduce crowding.Cramped conditions promote unrest and violence, the justices said. The court's ruling cited a medical expert who testified that forcing large numbers of inmates to share a few toilets made the congested areas breeding grounds for disease.The crowding was unhealthy and dangerous not only for inmates, the court said, but for the guards, as well. The ratio in some overcrowded dormitories was often two or three guards for every 200 inmates."They provided an accurate and extremely graphic example of the crowding and inhumanity that engulfed the entire system," said Don Specter, director of the nonprofit Prison Law Office in Berkeley, which sued to force the state to ease crowding as a way to improve the treatment of sick and mentally ill inmates.The use of the overflow beds dates back a quarter-century but spiked when California prisons filled to bursting as get-tough sentencing laws took effect. At the peak in August 2007, the department had 72 gyms and 125 dayrooms jammed with 19,618 inmate beds.Cate, the corrections secretary, spoke to reporters Friday in an empty football field-sized field house that once was home to nearly 700 inmates sleeping in dense rows of bunks stacked so high that guards couldn't see over them. That created opportunities for unseen assaults and drug deals, said Correctional Sgt. Corey Johnson."All of a sudden we have an echo, whereas before there was a din of noise," Cate said.Thick rubber mats had been removed from the gym's wooden floor, basketball hoops had been lowered into place, and a lone basketball was seen at a stainless steel picnic table.Inmate Gary Richards said he used to fear other inmates when he lived in the crowded area."Now we can play basketball," said Richards, 23, of Oakland, who is serving an eight-year, four-month sentence for assault with a deadly weapon and other crimes.At one point, more than 1,000 inmates were shoehorned into makeshift areas at the prison, crowding that officials said helped spark a riot in 2003 that injured nine inmates and one employee.The institution once offered 13 vocational education programs, including painting, welding, office machine repair, shoe repair and electronics, which disappeared.Now that there is more space for classrooms, officials said the prison is expected to offer classes in welding, plumbing, heating and air conditioning, and auto body repair."There were no vocational programs," Cate said, "and they are on their way back."Cate said space that once contained as many as 800 overflow beds statewide has been renovated into permanent housing, prompting criticism from the union representing most prison guards."They're just changing the names so they can say they got rid" of the beds, said Ryan Sherman, a spokesman for the California Correctional Peace Officers Association.Still, prisons are safer with fewer inmates — as long as the state doesn't lay off too many guards, Sherman said."We're still doing the overcrowding, but not as much, and we'll still be understaffed, but not as badly," he said.Specter and other attorneys representing inmates calculate that at its current downsizing rate, California will still have 6,000 more inmates in its 33 adult prisons by June 2013 than allowed by the federal court order. The nonpartisan state legislative analyst says the state will meet the goal eventually, but not in time to meet the court deadline.Both sides said the state may need to consider even more steps to reduce the inmate population. Cate, however, said their fears are premature and the state could ask for more time if crowding doesn't ease fast enough.Of California's nearly 142,000 inmates, roughly 9,500 are in private prisons in other states. Another 5,000 are in firefighting camps or private prisons in California.