Former House Speaker Newt Gingrich, a potential running mate on the Republican ticket, said Sunday Donald Trump’s criticism of a federal judge with Mexican ancestry is “one of the worst mistakes” the candidate has made.

“This is one of the worst mistakes Trump has made,” Gingrich said on “Fox News Sunday.” “I think it’s inexcusable. He has every right to criticize a judge, and has ever right to say certain decisions aren’t right, and his attorneys can file to move the venue from the judge. But first of all, this judge was born in Indiana, he’s an American, period.”

Over the last week, Trump has gone after U.S. District Court Judge Gonzalo Curiel, who is presiding over lawsuits against the now-defunct Trump University. Trump has argued Curiel can’t be impartial because he’s “of Mexican heritage” and Trump talks of “building a wall” along the border.

“It’s an inherent conflict of interest,” Trump told the Wall Street Journal last week.

Speaking of those comments, Gingrich said: “If a liberal were to attack Justice Clarence Thomas on the grounds that he’s black, we would all go crazy.”

“Trump has got to, I think, move to a new level,” Gingrich added. “This is no longer the primaries. He’s no longer an interesting contender. He is now the potential leader of the United States and he’s got to move his game up to the level of being a potential leader.”

Asked by Fox anchor Chris Wallace if he considers Trump’s remarks amount to racism, Gingrich said: “I think it was a mistake. I hope it was sloppiness.”

Gingrich’s willingness to speak out against Trump is notable considering the former speaker — who has been supportive of the New York businessman — is believed to be a possible contender for vice president.

Gingrich and Trump are thought to have a good relationship. Just on Saturday, Gingrich’s wife, Callista, posted a photo on Instagram of the couple playing golf at one of Trump’s courses.

Checking out the course. A photo posted by Callista Gingrich (@callygingrich) on Jun 4, 2016 at 1:07pm PDT

Follow Alex on Twitter