(CNN) A judge in Utah has been suspended without pay for six months after he made critical comments about President Donald Trump in court and on his Facebook page.

According to the ruling by the Utah Supreme Court, Judge Michael Kwan's Facebook posts were "laden with blunt, and sometimes indelicate, criticism" of Trump.

The comments were made over the last several years, during both Trump's 2016 campaign and after he became President. They included a reference to the "Access Hollywood" tape in which Trump made crude comments about women and in one instance referred to his presidency as a "fascist takeover."

Utah's Supreme Court concluded Kwan's remarks violated the state's Code of Judicial Conduct and could potentially undermine the judiciary's integrity and impartiality.

"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," said the ruling, authored by Utah Supreme Court Justice John A. Pearce. "And it diminishes the reputation of our entire judiciary."

Kwan's attorney, Gregory Skordas, told CNN he and his client "were disappointed with the ruling but not necessarily surprised."

Skordas said Kwan acknowledges he made comments about political candidates and elected officials, "but felt that his overriding message was on policies and not candidates."

"He is a beloved man and his passion for his culture is what got him in trouble," Skordas said of his client, the son of Chinese immigrants who fled persecution. "We probably have no recourse but to sit out the six months and hope that he still has a court to preside over when that period has lapsed."

Judge Michael Kwan has sat on the justice court in Taylorsville, Utah, for two decades.

Judge in 2017: Welcome to 'the fascist takeover'

Kwan will likely return to the bench once his suspension is over, Taylorsville spokeswoman Kim Horiuchi told CNN.

Although Taylorsville is under no obligation to rehire Kwan, Horiuchi said that "as far as we know" the city will hire him back after the suspension. The city has hired an interim judge who starts work Tuesday and will leave after Judge Kwan returns, she said.

The city has no concerns about Kwan's impartiality, Horiuchi said.

Kwan has been reprimanded twice in the past for apparent violations of the code of conduct, the ruling noted. One case dealt with a "crass in-court reference" to the sexual conduct of a former president, and the other with Kwan's political activities as president of a nonprofit.

This time he faced several allegations of misconduct, including comments made on his Facebook page and on LinkedIn, comments made in court, and the improper handling of a personnel matter.

Several days after the 2016 election, the ruling said, Kwan wrote, "Think I'll go to the shelter to adopt a cat before the President-Elect grabs them all" -- a thinly-veiled reference to the "Access Hollywood" tape in which Trump was heard using vulgar language to refer to grabbing women's genitals.

On the day of Trump's inauguration, Kwan made a comment directed at the President that said, "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?"

On February 13, 2017, several weeks after Trump's inauguration, Kwan made another post, the ruling said.

"Welcome to the beginning of the fascist takeover," it read, questioning whether Republicans in Congress would "be the American Reichstag and refuse to stand up for the Constitution," referring to the parliamentary body of Nazi Germany under Adolf Hitler.

The ruling said these examples "are illustrative" but "not a comprehensive recitation" of comments the judge made and articles he shared online that referred to Trump.

He questioned Trump's tax, immigration policies

Besides his political commentary on Facebook, the judge also made a remark to a defendant in his courtroom "that appeared to demean the defendant and included political commentary regarding President Trump's immigration and tax policies," the ruling said.

According to the ruling, the defendant indicated they were waiting for a tax return to pay off court fines, to which Kwan expressed doubt as to whether the defendant was getting money back due to Trump.

"Prayer might be the answer," Kwan said, according to the ruling. "'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."

Kwan then referred to a tax cut for people who make over $500,000, and questioned whether the defendant made that much money.

Kwan had argued the comment was meant to be funny, but the ruling said "It is an immutable and universal rule that judges are not as funny as they think they are."

There is a "decent chance," the ruling said, that someone in a courtroom would laugh at a judge's joke due to the "courtroom's power dynamic and not by a genuine belief that the joke was funny."

Supreme Court: Kwan's comments threatened his impartiality

Kwan had argued that the comments he made were constitutionally protected by the First Amendment, a claim the Utah Supreme Court didn't directly address in its ruling.

But it said a more important issue was that Kwan "implicitly used the esteem associated with his judicial office as a platform" to criticize a candidate.

Judges, the ruling noted, must make sacrifices in their line of work.

"Fulfillment of judicial duties does not come without personal sacrifice of some opportunities and privileges available to the public at large," it said, adding that a judge must sometimes "set aside the power of his or her voice ... as a tool to publicly influence the results of a local, regional, or national election."

While Kwan's remarks addressed political issues on a national level, the ruling said, those issues could factor into questions that come up in court. Additionally, they could "cause those who disagree with Judge Kwan's politics to believe that they will not receive a fair shake when they appear before him."

Skordas, Kwan's lawyer, said he and his client had hoped the state Supreme Court "would be more sympathetic" to Kwan's situation as a child of immigrants. He also said he believes that the harsh punishment was perhaps driven by the fact Kwan was reprimanded in the past.

Ultimately, Skordas said, he and Kwan feel " the sanction is grossly disproportionate to the conduct."