A Milwaukee judge has sentenced a former jail deputy to 30 days in prison for shutting off water to the cell of an inmate who died of dehydration in 2016.

The order Thursday will give James Lee Ramsey-Guy work-release privileges so he can keep his job. He was sentenced for resisting or obstructing an officer, a misdemeanor, as part of a plea agreement.

Two other county jail staffers were charged in the death of 38-year-old Terrill Thomas. Ramsey-Guy's supervisor ordered him to turn off the water because Thomas had flooded his cell with a mattress.

Thomas' family has said he was having a mental breakdown when police arrested him April 14, 2016, for shooting a man in front of his parents' house and later firing a gun inside a casino.