LANCASTER, Pa. — A Pennsylvania sheriff accused of sending pornographic emails to a subordinate has resigned, ending a yearlong effort by local and state officials to remove him from office.

LNP reports Lancaster County Sheriff Mark Reese is resigning effective Monday.

A judge was supposed to decide Friday whether the 59-year-old Reese could return to his job more than a year after taking a voluntary leave of absence. Reese’s lawyer says in a letter obtained by LNP that Reese has decided to resign.

State lawmakers in April authorized an investigation of Reese that could’ve led to the first impeachment of a state official since 1994.

A county deputy sheriff filed a complaint in July 2016 against Reese, claiming he sent her explicit messages.

County commissioners say Reese admitted sending pornographic and inappropriate emails to the deputy.

Information from: LNP,