Utah judge had posted comments against Donald Trump on Facebook and LinkedIn. (File)

A US judge has been suspended for six months without pay after making derogatory comments about Donald Trump, including criticizing his "inability to govern and political incompetence."

Utah judge Michael Kwan's suspension earlier this week by the state's supreme court says that his behavior was in violation of the judicial code of conduct and sullied the reputation of the judiciary.

"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," the court said in a 19-page opinion.

As regards Kwan's postings about Trump on Facebook and LinkedIn, the court said they "were laden with blunt, and sometimes indelicate, criticism."

In one posting on January 20, 2017, when Trump was inaugurated president, Kwan wrote: "Welcome to governing. 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?"

In another posting a month later, Kwan wrote: "Welcome to the beginning of the fascist takeover."

He continued, "We need to... be diligent in questioning Congressional Republicans if they are going to be the American Reichstag and refuse to stand up for the Constitution, refuse to uphold their oath of office and enable the tyrants to consolidate their power."

On another occasion while presiding over a hearing, Kwan got into an exchange with a defendant in which he appeared to criticize Trump's immigration and tax policies, the court said.

The defendant told Kwan that he planned to pay all of his court fines when he got his tax returns.

"You do realize that we have a new president, and you think we are getting any money back?" Kwan told the defendant

"Prayer might be the answer," Kwan added.

"'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, who has served as a judge in the city of Taylorsville for the past two decades and has a history of misconduct linked to politically charged comments and his temper, has acknowledged that his behavior was unbecoming a judge.

But he described his in-court political statements as an attempt at humor and argued, unsuccessfully, that a suspension would amount to infringing on his freedom of speech.