ALBANY -- Former state Sen. George Maziarz avoided a trial Friday and pleaded guilty to a misdemeanor charge in a corruption case.

The former western New York senator appeared in state Supreme Court on Friday afternoon and pleaded guilty to one misdemeanor charge of filing a false instrument and agreed to pay a $1,000 fine.

He also admitted to knowingly hide campaign payment to a former aide that was the heart of the case.

Maziarz, R-Newfane, Niagara County, was charged in March 2017 with five felony counts of offering a false instrument for filing. The charges could have come with prison time if he was convicted, though such a sentence was unlikely.

His trial was slated to start next week.

Maziarz, 64, was accused by Attorney General Eric Schneiderman of hiding $95,000 in campaign payments to a former staff member who was accused of sexual harassment.

The case embroiled Niagara County Republican leaders and already lead to the misdemeanor guilty plea of former Niagara County GOP chairman Henry Wojtaszek,

Wojtaszek's guilty plea dealt with his work as an "agent" for Maziarz's campaign, which came after he stepped down as Niagara GOP chair in 2009. He now heads the Western Regional Off-Track Betting Corp.

The charges contended that payments from Maziarz's campaign account and the Niagara County GOP were routed through public-relations firms rather than paid directly to the former staffer -- a way, Schneiderman charged, to disguise the payments.

The payments were made between 2012 and 2014, according to court papers.

Maziarz served in the Senate for 20 years, but he left in 2015. His district stretched across western New York and into a portion of the city of Rochester.