A 70-year-old town justice accused of behaving belligerently toward an ex-girlfriend, including threatening to prosecute her, will step down from the bench at the end of the month.

Gary M. Poole, a Rose Town Court justice in Wayne County, agreed to resign effective July 1 and never to seek or accept judicial office again, the New York State Commission on Judicial Conduct announced Monday.

The commission began investigating Poole in January 2017 after receiving complaints that he “engaged in repeated, undignified and discourteous conduct” toward a woman with whom he had been romantically involved.