A nonattorney Western New York judge resigned amid allegations he sexually harassed a court clerk, the state’s judicial misconduct watchdog said Monday.

Former Bethany Town Justice Joseph Nowakowski of Genesee County had been accused of sending the woman inappropriate text messages unrelated to court business, and when she told him to stop, he retaliated by trying to have her fired, the New York State Commission on Judicial Conduct said in a statement.