A Western New York judge has agreed to resign at the end of September in the wake of allegations that he made a culturally-insensitive comment to a defendant at sentencing and posted racially-offensive material in the courthouse, the state Commission on Judicial Conduct said Wednesday.

Leonard Tilney, 71, an attorney who has been a justice of the Lockport Town Court in Niagara County since 2004, was already planning to retire when the decision was made, his attorney said, but agreed with the CJC to never seek judicial office again.