SUMMIT COUNTY, Utah — A former Utah jail deputy charged with stunning inmates with a Taser and using them for police-dog training was sentenced Monday four months in jail.

Joshua J. Cox, 27, had faced the most serious allegations in an investigation that led to the resignation of the Daggett County sheriff and shuttering of the jail that had brought the rural county $1.4 million for housing state prison inmates.

Cox told a judge that he became a scapegoat for a problem-plagued system.

“That jail and that department was poison, and I let it get to me,” he said, according to the Deseret News. Cox said his neighbors blamed him for the loss of jobs that came with the drop in revenue.

His lawyer, Loni DeLand, said local police became too familiar with the inmates, drinking soda and participating in “horseplay.”

State Attorney General Sean Reyes, on the other hand, has said the treatment of inmates was “unbelievably inhumane.”

Prosecutors said Cox used a Taser as an initiation to an inmate work crew, required one inmate to withstand the stun gun in exchange for keeping his work privileges, and promised inmates soda if they could endure it for five minutes.

He was also accused of bringing uncertified police dogs into the jail and ordering two inmates to participate in training the dogs. Both were bitten by the unleashed animals, prosecutors said.

Cox pleaded guilty to two counts of felony aggravated assault, one felony count of taking a weapon into a secure facility and one misdemeanor theft charge. Prosecutors said the theft charge came because the Taser was stolen from the police department where Cox used to work. Seven other counts were dismissed in exchange for his guilty pleas.

Cox will serve his 120-day sentence in the neighboring Uintah County lockup.

Two other officials, the former Daggett County sheriff and jail commander, also pleaded guilty to charges in the investigation that led to the closure of the 80-bed Daggett County jail.

A lawyer for former Sheriff Jerry R. Jorgensen said he wasn’t involved, but he pleaded guilty to misdemeanor official misconduct to take responsibility for what happened under his leadership.

Jail commander Benjamin Lail got a year of probation and a fine after being charged with pointing a Taser at a woman’s foot.

The jail is near Flaming Gorge National Recreation Area in the small town of Manila on the Wyoming border.