SANTA CLARA (CBS SF) — Thirty-one gang members housed in the Santa Clara County Jail have been indicted by a grand jury on charges of attacking a fellow inmate for about six minutes, leaving him bloody, naked and with broken bones.

Santa Clara County District Attorney Jeff Rosen said the charged inmates attacked the 40-year-old man in a dorm room they all shared at the Elmwood Correctional Facility in Milpitas.

READ MORE: San Jose Mom Samantha Rodriguez Waives Extradition In Son's Murder Case; Returning To Las Vegas

The mass jail attack happened around 7:30 p.m. on November 30 and was motivated because the victim cooperated with law enforcement on a pending criminal case.

The brutal assault occurred within a few minutes after the victim was brought into the housing unit. When he entered the room, a group of his fellow inmates gathered and began punching and kicking the victim.

Eventually, the victim was dragged into a space that was near the guards’ window, where he was punched and an attacker poured floor cleaner on his bloody face. Finally – after 5 minutes and 37 seconds – the attack ceased. The attack was captured on video surveillance, prosecutors said.

READ MORE: Fourth Stimulus Check: Will You Get Another Relief Payment?

The evidence showed that the assailants as well as the victim were active gang members. The attack occurred in an open dormitory-style jail unit limited to gang members.

All 31 inmates were charged with felony assault and active participation in a criminal street gang. Nineteen of the inmates were additionally charged with personal infliction of great bodily injury. Two inmates were charged with witness intimidation and five inmates were charged with retaliation against a witness.

Gang allegations have been filed against all the defendants. They were arraigned Monday and face significant prison time if convicted.

MORE NEWS: Bay Area, NorCal Heatwave May Break Records; 'Potentially Life-Threating' Central Valley Temps

“The jail is not a law-free zone where anything goes,” Rosen said in a news release. “Violence is no more acceptable behind bars than it is outside them.”