SACRAMENTO, Calif. (AP) — California prison officials say they will change the rules for using pepper spray on mentally ill inmates in state prisons, as a federal judge considers whether current practices violate inmates' civil rights.

Spokeswoman Deborah Hoffman says the department will limit how much pepper spray can be used and how quickly. The rules are still being written and would not apply to emergency situations.

The state's announcement Wednesday comes as U.S. District Judge Lawrence Karlton ordered corrections officials to publicly release videos that show prison guards pumping rounds of pepper spray into the cells of mentally disturbed inmates, some of whom begin shrieking or yelling for help.

The videos were shown during a hearing before Karlton over the use of force against mentally ill inmates.