The state attorney general's office said Miles Karson was also sentenced Wednesday to community service.
The former Mercer County district attorney was convicted in January of obstruction and official oppression.
Karson had been accused of asking a probation officer to not put the 41-year-old woman in jail after she acknowledged using heroin.
The 73-year-old Karson also allegedly tried to get a judge to release the woman on bond by saying he was a family friend.
In his testimony, Karson said he was only trying to help her and didn't break the law.
Copyright 2019 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.