NEW YORK (CBSNewYork) — Mayor Bill de Blasio on Thursday called a remark about his wife by opponent Bo Dietl un-American.

As WCBS 880’s Alex Silverman reported, Dietl appeared at a Republican event on the Upper East Side Wednesday night, and talked about the judge who blocked him from running in the Democratic mayoral primary this year because of a paperwork error.

READ MORE: NYC Mourning NYPD Officers Wilbert Mora, Jason Rivera After Deadly Ambush In Harlem

“I checked two boxes, because I wanted to run as an independent and a Democrat, but I always wanted that independent line. You know what happened? They threw me off. And you know what happened? I went to Supreme Court, and de Blasio had three lawyers there, and the judge wouldn’t even hear the defense. And you know what they said to me? They said to me, ‘You are a man with no party,’” Dietl said at the event. “That just got me – this is just de Blasio’s tentacles reaching – first of all, the judge looked like Chirlane de Blasio, and as soon as I saw her – as soon as I saw her – I knew I had a problem. She wouldn’t let me talk.”

Both Manhattan Supreme Court Judge Debra James and the mayor’s wife Chirlane McCray – who goes by her maiden name – are black.

Dietl defended the remark to Politico, which noted that fellow GOP candidate Paul Massey said Thursday that Dietl had made a “racist remark,” and said it “shows why (Dietl) has no place in the Republican Party.”

“It’s not supposed to be a racist thing,” he said.

Dietl also addressed the remark on WNYC’s “The Brian Lehrer Show” Thursday morning.

“She looked like Chirlane de Blasio,” he said. “So if I walked into a divorce court and I’m going through a divorce with my wife, and that judge looked like my wife, I’d go, ‘Uh oh, I’ve got a problem, she looks like my wife. That’s how I said it, and that’s how it should have been taken.”

READ MORE: Gov. Hochul, Mayor Adams: New Interstate Task Force On Illegal Guns To Focus On Safety Of New York City

Mayor de Blasio slammed Dietl over the remark.

“You know there is supposed to be respect for the judiciary,” de Blasio said.

The mayor drew a direct line to President Donald Trump’s comments about U.S. District Judge Gonzalo Curiel, who presided over the Trump University lawsuits. Trump at one point claimed that Curiel could not preside fairly over the case because the judge is of Mexican heritage and Trump wanted to build a wall between the U.S. and Mexico. Curiel was born in Indiana.

“Oh that judge made that decision because they are white, because they are black because they are a man, because they are a woman, because they are from another country. I’ve never heard that talk before Donald Trump started it. And now Bo Dietl is continuing it. It’s not American. It’s just not American.”

“‘Oh, that judge made that decision because they’re white, because they’re black because they’re a man, because they’re a woman, because they are from another country’ — I’ve never heard that talk before Donald Trump started it,” de Blasio said. “And now, Bo Dietl is continuing it. It’s not American. It’s just not American.”

Asked what McCray thinks, de Blasio said she does not pay attention to Dietl.

MORE NEWS: Reports: Supreme Court Justice Stephen Breyer Plans To Retire, Paving Way For President Biden Pick

In addition to being a former NYPD detective, Dietl is also a businessman, an author, and an actor. Among his credits is a star turn in “Wolf of Wall Street” with Leonardo DiCaprio.