The California Department of Corrections and Rehabilitation "is revising the use of force policies to limit the duration of pepper-spray applications, the total number of applications and the minimum waiting period between applications in non-emergency situations," said Jeffrey Callison, press secretary for CDCR.

The videotapes, released by a federal court, show one prisoner screaming for help after being doused with pepper spray.

Inmate attorney Michael Bien told KCRA 3 the incidents involved prisoners with "serious mental illness, and most are in a psychotic state."

On the videotape, correctional officers can be heard saying that one inmate had smeared his body with feces and refused to take his prescribed medications.

"They use massive amounts of pepper spray," Bien told KCRA 3. "They’re using crowd control devices in cells. These are things designed for large groups of people outside, and they’re using them inside a cell."

Callison responded, "What you don’t see in these videos are hours of discussion that take place between the inmate and the clinical staff before a cell extraction is ordered."

Bien has sued the state in federal court, seeking a change in the way mentally ill prisoners are treated.

"It is a system-wide problem," Bien told KCRA 3. "These correctional officers were doing their jobs as they were trained. And to me, that’s the most shocking. That’s the way it’s supposed to happen. They testified to that here in trial."

"The use of force is always a last resort for our staff," Callison said. "And cell extractions are typically done to keep inmates from harming themselves or others, and to ensure that they’re placed in a more appropriate mental health setting."

U.S. District Court Judge Lawrence Karlton issued a court order Friday, prohibiting further distribution of the videotapes because they inadvertently allowed inmates to be identified.

But the Sacramento Bee obtained copies before the court order was issued.