BUFFALO, N.Y. (WIVB) — A former Erie County Sheriff’s deputy could spend up to one year in jail.

Adam Fiegl pleaded guilty to criminal possession of a controlled substance Friday.

Prosecutors said he took bribes and brought Suboxone to inmates at the holding center. Suboxone is used to treat opioid addiction.

Bribery and contraband charges were dismissed as part of the plea deal.

As another part of his plea deal, Fiegl was allowed to resign, instead of be terminated by the Sheriff’s Office.

Originally, Fiegl was terminated, but he filed a grievance against the decision.