A federal judge says California is violating the rights of some mentally ill inmates.

Judge Lawrence Karlton wants the Corrections Department to change how it uses force against the mentally ill after videos surfaced of guards throwing chemical grenades and pumping pepper spray into the cells of such inmates -- some could be heard screaming and he called the films "horrific."

The state has 60 days to change its policies and Karlton also wants the use of isolation limited.

Attorneys for the mentally ill argued that can aggravate their condition and lead to a downward spiral.

Mentally ill inmates account for 28 percent of the prison population.