UNION, S.C. -- A city prosecutor in Union has been accused of abusing his position to get sex.

Sheriff David Taylor says 65-year-old William E. Whitney Jr. has been charged with misconduct in office. Authorities say Whitney is accused of dismissing charges against criminal defendants in exchange for sexual favors.

Deputies say that, between July 2011 and September 2012, Whitney agreed to dismiss charges against defendants in exchange for sexual favors.

Whitney resigned last week. He said in a handwritten letter that he had planned to retire in January but wanted to resign immediately because of “health problems.”

Whitney faces up to 10 years in prison if convicted. It wasn’t known if he had an attorney.