An inmate walked through the hallway of a maximum security unit of the Santa Rita Jail, authorities said, carrying a plastic bottle filled with feces and urine.
In seconds, he had squeezed the bottle, spraying its contents through the cracks of a door into a cell housing another inmate.
He did the same thing several times to different inmates during the summer and fall of last year.
Authorities say four Alameda County sheriff's deputies knew about and even facilitated the "gassing" attacks.
Those deputies — Justin Linn, 23; Erik McDermott, 27; Sarah Krause, 26; and Stephen Sarcos, 30 — were arrested Thursday on suspicion of assault under the color of authority, according to the Alameda County Sheriff's Office.
All were freed after posting bail.
A lengthy investigation began after jail employees told supervisors in January about the alleged abuse. The four deputies were pulled from duty soon after.
Sarcos resigned during the investigation. The rest remain on paid leave, according to Sgt. Ray Kelly.
Authorities interviewed more than 40 people, including sheriff's office employees and inmates in the county jail and various state prisons.
Krause and Sarcos are accused of involvement in one attack, while authorities allege that Linn and McDermott were complicit in several. Linn and McDermott also are accused of intimidating witnesses to keep them from speaking to investigators.
The inmate who staged the attacks was not identified. It's unclear whether he will be charged.
It's also unclear whether the deputies orchestrated the attacks to punish inmates or whether they stood by idly during the assaults.
Prosecutors are looking at whether the inmate who staged the attacks was under duress or feared retaliation if he didn't comply with the jail deputies, Kelly said.
"There was a reason they had concocted to do each and every incident," Kelly said. "The reason why? We don't know."
Sheriff Gregory Ahern, in a statement, called the allegations "egregious and shocking."
"We have sought charges against the four individuals and they must now answer to these allegations," he said. "The actions of these four individuals do not reflect the dedication and professionalism of the 1,600 employees who work at the Alameda County Sheriff's Office."
The case prompted agency officials to review internal policies.
"A lot of the mechanisms in place to alert supervisors to this criminal behavior worked," said Kelly, who credited the employees who came forward. "It was picked up rather quickly."
A plan is in the works, he said, to install video cameras "everywhere we can put them within the facility."