OAKLAND, Calif. (AP) — Two former Alameda County sheriff’s deputies were sentenced to prison Wednesday for abusing jail inmates by, among other things, telling other prisoners to throw urine and feces on them.

Justin Linn and Erik McDermott were each sentenced to four years and four months in state prison. They earlier pleaded guilty to assault by a public officer and dissuading a witness by threat or force, according to the Alameda County district attorney’s office.

Prosecutors said that while working at Santa Rita Jail in Dublin in 2016 and 2017, the deputies got two inmates to throw bodily fluids on at least five other inmates for the deputies’ entertainment, attacks known as “gassing.”

The attackers received special treatment, such as extra food or time outside of their housing pod.

One inmate testified in 2019 that he committed dozens of gassings.

Another inmate told the Bay Area News Group that he was gassed daily after writing letters to Linn and McDermott’s supervisor and to media outlets complaining of their actions.

“It was so bad that the crime scene restoration crew had to constantly come out and sanitize the place,” he wrote.

District Attorney Nancy O’Malley said the deputies committed “sadistic and terrorizing acts.”

“The conduct of these defendants violated the law and there was no rational explanation for their actions aside from abject cruelty and a disregard for the humanity of the inmates,” O’Malley said in a statement.

Two other former deputies charged in the same case, Sarah Krause and Stephen Sarcos, made plea deals to several charges last year and avoided jail.