A judge in Upstate New York was forced off the bench after posting online the image of a noose and a Trump campaign slogan, which a state commission concluded showed political or racial bias, officials said Tuesday.

Kyle R. Canning, a part-time judge in Altona, N.Y., near the Canadian border, posted an image to his Facebook account of a noose, with the words: “IF WE WANT TO MAKE AMERICA GREAT AGAIN WE WILL HAVE TO MAKE EVIL PEOPLE FEAR PUNISHMENT AGAIN.”

The New York State Commission on Judicial Conduct said that Canning, 29, failed “to maintain high standards of conduct so that the integrity and independence of the judiciary would be preserved,” that he failed to avoid impropriety and the appearance of impropriety, and that he “failed to respect and comply with the law and failed to act in a manner that promotes public confidence in the integrity and impartiality of the judiciary.”

The noose, the commission said, conveyed racial and/or political bias.

“The noose is an incendiary image with repugnant racial connotations,” Commission Administrator Robert H. Tembeckjian said.

“It is the very antithesis of law and justice. For a judge to use the image of the noose in making a political point undermines the integrity of the judiciary and public confidence in the courts.”

Canning posted the message online in early 2018; someone complained to the commission in August of that year, and the commission lodged a formal complaint against him in May of this year.

In his June resignation letter, Canning said he was quitting his position “with a sense of despair. They have presented me with several different options in resolving what they claim to be a serious offense.

“I feel as though, due to my current financial situation and obligations to my family, I am being coerced into resigning.”

He also apologized to his fellow Altona judge “for the inconvenience and hardship” of his departure.

Canning also agreed to never seek or accept another judicial position.