An Ontario Court judge wore a "Make America Great Again" hat in his courtroom the day after the U.S. election to mark president-elect Donald Trump's "historic" victory, according to a source in the room.

Ontario Court Justice Bernd Zabel arrived at the John Sopinka courthouse in Hamilton on Wednesday morning wearing Mr. Trump's signature campaign hat, according to the source, and addressed the numerous lawyers, police officers and defendants. Another witness in the courtroom did not dispute the details.

The incident has prompted an outcry from legal observers who say Justice Zabel's political display undermines the public's confidence in judicial impartiality. And they are particularly upset because Mr. Trump has made disparaging remarks about women and minorities.

Story continues below advertisement

Read more: Carbon-tax comittment puts Trudeau at odds with Trump

Read more: Racist incidents reported in wake of Trump victory

Read more: Respectful tone between Obama, Trump at White House a contrast to campaign

"The clerk said 'all rise' and the door opens and Justice Zabel comes out. He is in a black silk robe with the crimson sash and the white tie. He has a poppy on his lapel. And he is wearing a scarlet-coloured baseball cap that says Make America Great Again. And we all stand because we are supposed to stand when the judge comes in and he looks at everyone and said he was wearing the hat 'because last night was an historic occasion,'" the source told The Globe and Mail.

"He took the hat off and put it on the bench so everybody could look while he continued his court business. He didn't put it away. It was sitting on the bench." Mr. Zabel then came back with the hat after morning break, the source said.

Justice Zabel did not return phone calls Thursday requesting comment about the incident. A spokesman for Ontario's Ministry of the Attorney General referred requests to the Chief Justice of the Ontario Court of Justice, Lise Maisonneuve, who declined to comment when contacted by The Globe. Assistant Crown Attorney Janet Booy also declined to comment.

One lawyer who was in the room had an exchange with Justice Zabel about whether the lawyer would travel to the United States. When contacted, Mike Wendl said, "I don't exactly remember the words."

Story continues below advertisement

"I can tell you I am not going to the U.S. for the next four years. I may or may not have said that," Mr. Wendl said.

For Kim Stanton, legal director at the Women's Legal Education and Action Fund, the hat is especially problematic because of Mr. Trump's derogatory comments about women. He has also proposed temporarily banning Muslims from entering the United States, deporting undocumented immigrants and building a wall along the Mexican border.

"Unfortunately for many women, Trump is now linked inextricably with misogyny. The idea that a judge in a Canadian court would not just make a partisan political display but also link to someone who is now infamous for misogynous comments and conduct would absolutely suggest to a woman that this might not be a courtroom where she'll have a fair shake," Ms. Stanton said, adding that she thinks there should be a complaint to Madam Justice Maisonneuve. The attorney-general spokesman said complaints can be made to the Ontario Judicial Council.

Shahzad Siddiqui, a Muslim lawyer in Toronto, said many in his community would fear a bias if they appeared in front of the judge.

"I imagine that Muslims attending that court would be uncomfortable, especially if they were women in the veil," Mr. Siddiqui said.

Osgoode Hall Law dean Lorne Sossin said he doesn't think the incident is serious enough to constitute misconduct but it warrants a warning that such behaviour shouldn't continue.

Story continues below advertisement

He cited section 1.1 of the Ontario Judicial Council's principles of judicial office, developed by judges of the Ontario Court of Justice. That section says "Judges should maintain their objectivity and shall not, by words or conduct, manifest favour, bias or prejudice towards any party or interest."

William Trudell, chair of the Canadian Council of Criminal Defence Lawyers, suggested such an incident be dealt with internally.

"It sounds to me like a very unusual situation on a very unusual day in history. He's a fine judge and that's all I would say," Mr. Trudell said.

"I think everybody reacted in his own way to a most unusual day, and I look at this as a human error, perhaps, as opposed to a judicial one."