Sean Spicer. Screenshot/CNN White House press secretary Sean Spicer acknowledged Thursday that President Donald Trump has leveled attacks on the US judiciary and that Judge Neil Gorsuch said attacks on the judiciary were "demoralizing" and "disheartening."

But Spicer repeatedly insisted that Gorsuch's comments had nothing to do with Trump's comments, leading to heated exchanges with White House reporters about the issue.

Gorsuch, the 10th US Circuit Court of Appeals judge who was nominated by Trump to the fill vacant Supreme Court seat, made the comments on Wednesday during a meeting with Sen. Richard Blumenthal of Connecticut.

Blumenthal told reporters Gorsuch said he was disheartened by Trump's recent attack on a federal judge. A representative for the Supreme Court nomination team confirmed the judge's remarks to Business Insider on Wednesday.

"He said very specifically that they were demoralizing and disheartening, and he characterized them very specifically that way," Blumenthal said, according to CNN. "I said they were more than disheartening, and I said to him that he has an obligation to make his views clear to the American people, so they understand how abhorrent or unacceptable President Trump's attacks on the judiciary are."

But Trump took aim at Blumenthal in a Thursday tweet, saying the Connecticut Democrat "misrepresents" what Gorsuch said.

In a Thursday statement, Kelly Ayotte, the former Republican senator from New Hampshire who is leading the effort to help confirm Gorsuch, said the judge "made it very clear in all of his discussions with senators, including Senator Blumenthal, that he could not comment on any specific cases and that judicial ethics prevent him from commenting on political matters.

"He has also emphasized the importance of an independent judiciary, and while he made clear that he was not referring to any specific case, he said that he finds any criticism of a judge's integrity and independence disheartening and demoralizing," she continued.

Neil Gorsuch. Drew Angerer/Getty Images

But elsewhere Thursday morning, another member of the Senate, Republican Ben Sasse of Nebraska, relayed similar remarks that Gorsuch made to him about Trump's attacks on the judiciary.

Sasse told MSNBC that Gorsuch got "pretty passionate" when asked about Trump's remarks, adding that an attack on "brothers or sisters of the robe" is an attack on all judges.

Taking aim at Blumenthal's relaying of the comments, Spicer said Gorsuch was making "two very complete, distinct arguments."

Spicer said Gorsuch believed he "should not be commenting on a political matter or on specific things," but that "on the whole, he doesn't like attacks in general on the judiciary."

"It was a very distinct argument that he was making," Spicer said. "And that's where I think we've got to be clear. And that's what Senator Ayotte was saying. Very, very different. ... So you can't then take that and equate it back to the specific."

Asked specifically about Sasse's comments, Spicer avoided answering.

Over the weekend, Trump fired off a series of tweets during which he called US District Judge James Robart — appointed by President George W. Bush — a "so-called" judge. Robart had issued a nationwide stay on parts of Trump's executive order temporarily banning travel into the US from seven majority-Muslim nations while the US reviews its vetting procedures.

Trump later suggested that should any terrorist attacks occur while the stay was in place, the judge should be blamed. Critics of his remarks said the president was seeking to undermine the independence of the judiciary.

Spicer said on Thursday that Trump did not regret his comments.

"I think the president's comments speak for themselves," he said.

The press secretary said Trump "is going to speak his mind" and that the press corps didn't express "similar concern" when President Barack Obama commented during a State of the Union address on a Supreme Court decision in the Citizens United case.

"He is free to speak his mind," Spicer said of Trump. "Part of the reason the president got elected is because he speaks his mind."