In 2010, Judge Michael Kwan talks with a defendant during court in Taylorsville, Utah. (Jeffrey D. Allred/Deseret News/AP)

The Utah Supreme Court suspended a judge for six months without pay this week over disparaging remarks he made about President Trump online and in his courtroom.

The court ruling points to several instances in which Judge Michael Kwan, who has sat on the justice court bench for the city of Taylorsville for two decades, violated Utah’s judicial code of conduct.

Kwan made a biting remark about Trump’s polices during an exchange with a defendant in January 2017. The defendant said he planned to pay off his court fines when he received money from his tax return. Kwan mocked him for thinking he’d be getting a refund with Trump in office.

“I pray and cross my fingers,” the defendant said.

"Prayer might be the answer,” Kwan said, “ ’cause he just signed an order to start building the wall and he has no money to do that, and, so, if you think you are going to get taxes back this year, uh, yeah, maybe, maybe not. But don’t worry, there is a tax cut for the wealthy, so, if you make over $500,000, you’re getting a tax cut.”

Kwan said he was attempting to be funny, not rude, according to a footnote in the Supreme Court’s opinion, written by Justice John A. Pearce.

“It is an immutable and universal rule that judges are not as funny as they think they are,” Pearce said.

Through 2016 and 2017, Kwan posted negative commentary about Trump. On Election Day, he encouraged people to vote against him. The Supreme Court opinion shared several examples.

Three days after Trump’s victory, Kwan wrote on social media, “Think I’ll go to the shelter to adopt a cat before the President-Elect grabs them all,” in apparent reference to the infamous Access Hollywood tape in which Trump mused about grabbing women “by the pussy.”

On the day of Trump’s inauguration, Kwan posted: “Will you dig your heels in and spend the next four years undermining our country’s reputation and standing in the world? . . . Will you continue to demonstrate your inability to govern and political incompetence?”

A few weeks later, Kwan wrote, “Welcome to the beginning of the fascist takeover.” He also questioned whether congressional Republicans would be “the American Reichstag.”

The court ruled Kwan violated the sections of the code of conduct that require judges to be “patient, dignified and courteous” and also the portion that bans a judge from making comments that would undermine public confidence in his “independence, integrity and impartiality.”

Kwan defended his right to post political commentary on his private social media accounts as “constitutionally protected speech” under the First Amendment. The state Supreme Court disagreed.

Kwan has been reprimanded for political speech in the past: once for making a crude reference to former president Bill Clinton’s sexual conduct and once for serving as president of a nonprofit that took political stances.

“Repeated instances of misconduct are serious matters, which may render a judge not only subject to suspension, but also to removal from office,” Pearce wrote. “Judge Kwan’s behavior denigrates his reputation as an impartial, independent, dignified, and courteous jurist who takes no advantage of the office in which he serves.”

Questions of judicial impartiality have come under more intense scrutiny with Trump often berating judges who rule against his administration.

In April, U.S. District Judge Carlton Reeves gave a rare rebuff of Trump’s attack against the judiciary. He likened such critiques of judges’ decisions to efforts in the Jim Crow South to denigrate courts over civil rights decisions.

"Slander and falsehoods thrown at courts today are not those of a critic seeking to improve the judiciary’s search for truth,” Reeves said during a speech at University of Virginia School of Law. “They are words of an attacker, seeking to distort and twist that search toward falsehood.”