LANSING, Mich. (AP) — A Michigan prosecutor is resigning from office after being charged with hiring prostitutes hundreds of times and paying for sex with a woman who wanted help in a child custody dispute.

Ingham County Prosecutor Stuart Dunnings III submitted a letter of resignation to county officials on Tuesday, effective July 2. He is taking a medical leave of absence until then and says he won’t run for re-election this year. He didn’t give details in the letter about medical issues.

The 63-year-old Dunnings — who has been the elected Democratic prosecutor in Michigan’s capital area for nearly 20 years — has been charged with using the services of prostitutes, enticing a woman to become a prostitute and willful neglect of duty.

The case developed from tips during a federal human-trafficking investigation.