SACRAMENTO (CBS13) — Disturbing video of a mentally ill prisoner being pepper sprayed is surfacing through an order by a judge to release six videos showing guards and inmates.

READ MORE: City Of Lathrop Officially Opens New Police Department

The prisoner was pepper sprayed through his cell door by several officers in gas masks after he refused to take his medication.

The officers continued to give him orders, but when the man doesn’t comply again, the video shows the officers chaining one of his hands to the ground through the door.

The videos released in federal court show for the first time what attorney Michael Bien has been trying to prove in court—that some mentally ill prisoners are being subjected to cruel and unnecessary force.

READ MORE: Multiple Crews Respond To Fire In American River Parkway

“This person is clearly in distress, is clearly psychotic, yet they had no tactical tools available to them, other than what they were doing,” Bien said.

CDCR would not answer questions, but read us this statement: “What you don’t see on these videos is the hours of discussions that take place between the inmate and clinical staff before a cell extraction is ordered.”

But Bien says the issue is a system-wide problem.

“These officers were doing their job as they were trained, and that to me, that’s the most shocking,” he said. “That’s the way it was supposed to happen. These guys were doing it according to the book, and if that’s according to the book, there’s something wrong.”

MORE NEWS: Thursday's Show Info. (6/30/22)

The CDCR went on to say in its statement that they are “revising use of force policies to limit the duration of pepper spray applications, and the minimum waiting period between applications and nonemergency situations.”