A judge in Utah was suspended without pay for six months last week after criticizing President Trump — both online and in court — for his "political incompetence."

Judge Michael Kwan, who's been a justice court judge in Taylorsville, a suburb of Salt Lake City, since 1998. Between 2016 and 2017, he shared inappropriate posts on Facebook and LinkedIn about the president, according to Utah's State Supreme Court.

TRUMP: 'SLEEPY JOE BIDEN' HASN'T 'APOLOGIZED' FOR INVOLVEMENT IN 1994 CRIME LAW

Kwan violated the judicial code of conduct and lessened "the reputation of our entire judiciary," Justice John Pearce wrote in an opinion on Wednesday.

"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," Pearce said.

An investigation was opened after Kwan made comments about Trump during court in 2017, KSTU reported. He told a defendant who said he planned to use his tax refund for his court fees that he would need to pray in order to get a tax return because of Trump's proposed border wall along the southern border.

“Prayer might be the answer. ‘Cause, [Trump] 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 reportedly said. "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."

TRUMP SEIZES ON NYU PROFESSOR'S TWEET TO PUSH CHANGE OF LIBEL LAWS

On Inauguration Day in 2017, Kwan posted online: "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?"

The following month, he wrote: "Welcome to the beginning of the fascist takeover. . . 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."

An attorney for the judge — who was first appointed by elected city officials to a six-year term and was later voted in to keep the position — said that, like many others, Kwan felt strongly about the 2016 elections. Kwan, however, recognizes that judges are held to a higher standard.

CLICK HERE TO GET THE FOX NEWS APP

"He certainly regrets making those statements and is committed to not doing anything like that again," attorney Greg Skordas told The Associated Press.

It's unknown what Kwan's political affiliation is because he chooses to keep his voter registration private, an option available to any state voter, Justin Lee, director of elections for Utah's state elections, said.

Skordas noted the judge has been reprimanded previously during his career for comments critical of politicians from both major parties.

The Associated Press contributed to this report.