A federal judge ruled Thursday that California's treatment of mentally ill inmates violates constitutional safeguards against cruel and unusual punishment through excessive use of pepper spray and isolation.

U.S. District Court Judge Lawrence Karlton in Sacramento gave the corrections department time to issue updated policies on the use of both methods but did not ban them.

He offered a range of options on how officials could limit the use of pepper spray and isolation units when dealing with more than 33,000 mentally ill inmates, who account for 28 percent of the 120,000 inmates in California's major prisons.

The ruling came after the public release of videotapes made by prison guards showing them throwing chemical grenades and pumping large amounts of pepper spray into the cells of mentally ill inmates, some of whom are heard screaming.

"Most of the videos were horrific," Karlton wrote in his 74-page order.

Prison officials already promised to make some changes in how much pepper spray they use and how long mentally ill inmates can be kept in isolation, but attorneys representing inmates said those changes did not go nearly far enough.

Karlton gave the state 60 days to work with his court-appointed special master to further revise its policy for using force against mentally ill inmates.

The inmates' attorneys and witnesses also told Karlton during recent hearings that the prolonged solitary confinement of mentally ill inmates frequently aggravates their condition, leading to a downward spiral.

Karlton agreed, ruling that placement of seriously mentally ill inmates in segregated housing causes serious psychological harm, including exacerbation of mental illness, inducement of psychosis and increased risk of suicide.

His ruling is the latest development in a 24-year-old lawsuit that has prompted sweeping changes in how the state deals with the medical and mental health treatment of its inmates.

Corrections department spokeswoman Deborah Hoffman said prison officials are reviewing the order.

The Associated Press