A longtime Utah judge has been suspended without pay for six months after making critical comments online and in court about President Donald Trump, including a post bashing his 'inability to govern and political incompetence.'

Judge Michael Kwan's posts on Facebook and LinkedIn in 2016-2017 violated the judicial code of conduct and diminished 'the reputation of our entire judiciary,' wrote Utah State Supreme Court Justice John A. Pearce in an opinion posted Wednesday.

Kwan's Facebook account was private but could have been shared by friends, 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,' Pearce said.

Utah judge Michael Kwan has been suspended without pay for six months after making critical comments online and in court about President Donald Trump, including a post bashing his 'inability to govern and political incompetence'

Kwan has been a justice court judge in the Salt Lake City suburb of Taylorsville since 1998. He deals with misdemeanor cases, violations of ordinances and small claims.

He was first appointed by elected city officials to a six-year term and was retained in the position by voters.

Kwan argued the suspension was inappropriate and an unlawful attempt to regulate his constitutionally protected speech, Pearce wrote in the opinion.

Kwan's attorney, Greg Skordas, said the judge is disappointed with the severity of the suspension but accepted that he would get some reprimand.

Like many people after the 2016 election, Kwan felt strongly about the results and said some things 'in haste,' Skordas said.

He knows judges are held to a higher standard and must be careful, the lawyer said.

'He certainly regrets making those statements and is committed to not doing anything like that again,' Skordas said.

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, said Justin Lee, Utah director of elections.

Skordas said he doesn't know Kwan's political party but noted the judge has been reprimanded previously during his career for comments critical of politicians from both major parties.

Pearce referred to those past reprimands while justifying the severity of the suspension.

Taylorsville city officials agree with the punishment and expect Kwan to return to his position when his suspension ends, city spokeswoman Kim Horiuchi said.

Kwan's online posts about Trump started during the 2016 election.

On Inauguration Day, he posted: '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 next month, he posted: '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.'

The ruling suspending Kwan also cited an interaction in court with a defendant in 2017 in which Kwan criticized Trump after the defendant said he would use his tax refund to pay fines.

'You do realize that we have a new president, and you think we are getting any money back?' Kwan said.

'I hope,' the defendant replied.

A month after Trump's inauguration, he posted: '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.'

'You hope?' Kwan said.

'I pray and I cross my fingers,' the defendant said.

'OK. Prayer might be the answer cause he just signed an order to start building the wall and he has no money to do that,' Kwan 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.'

Kwan created a DUI and drug court, which won a governor's award for reducing drug and alcohol abuse and served on the Utah Judicial Council, according to his biography .

He is also the president of the Chinese Railroad Workers Descendants Association, which worked to earn their ancestors proper credit during the recent celebration of the 150th anniversary of the Transcontinental Railroad.

He is not the first judge to come under scrutiny or be reprimanded for political stances. A federal magistrate judge in San Antonio was suspended from leading citizenship swearing-in ceremonies in 2016 after he told new U.S. citizens that they 'need to go to another country' if they objected to Donald Trump's presidency.

That same year, a municipal judge in Akron, Ohio, came under fire after she attended a rally for Trump and stood behind him while holding one of his campaign signs.