LANSING, Mich. (AP) — A man who was accused of hiring prostitutes hundreds of times during his 20-year career as a Michigan prosecutor has been sentenced to a year in jail.

Stuart Dunnings III, who was the prosecutor for Ingham County, which includes the state capital of Lansing, pleaded guilty in August to misconduct in office and soliciting a prostitute in exchange for many other charges being dismissed. He was sentenced Tuesday.

His arrest earlier this year stemmed from a federal investigation into human trafficking.

Prosecutors say Dunnings paid women for sex over several years.

Dunnings said at Tuesday’s hearing that he has a sex addiction and that he “violated his oath” and “betrayed the trust” of his wife, family, colleagues and community. His attorney says Dunnings is being treated for that addiction.