BUFFALO, N.Y. (AP) — A former New York state lawmaker has pleaded guilty in federal court to trying to cover up making unwanted sexual advances to a female staffer.

The U.S. attorney's office in Buffalo says 53-year-old Marc Panepinto, a Buffalo Democrat, pleaded guilty Thursday to government corruption charges.

Panepinto, who was elected in 2014, traveled with a female staffer to New York City in January 2016 for a fundraiser for the lawmaker. Prosecutors say afterward he made several unwanted sexual advances toward the woman inside her hotel room.

The staffer resigned once she returned to Buffalo.

Panepinto was worried a state ethics investigation would hurt his re-election campaign in 2016. Prosecutors say he directed a staff member to offer the ex-staffer money and a job if she refused to cooperate with investigators.

Panepinto didn't seek re-election.

The guilty plea comes as lawmakers in Albany try to respond to the #MeToo movement, which has revealed chronic harassment in government, media and the entertainment industry. Lawmakers earlier this year voted to create a uniform anti-harassment policy for all government employees. The Legislature also passed legislation prohibiting secret legal settlements involving state officials, and directs the state labor agency to create new harassment standards for private companies.

While Panepinto is no longer a member of the Legislature, more than 30 sitting lawmakers have left office facing allegations of criminal or ethical misconduct since 2000.

More From WIBX 950