Image copyright EPA Image caption Supreme Court nominee Judge Neil Gorsuch (R) meets Democratic Senator Richard Blumenthal on Capitol Hill on Wednesday

President Donald Trump's nominee for the Supreme Court has described the president's attacks on the judiciary as "disheartening and demoralising".

Neil Gorsuch's comments were made to a Democratic senator and confirmed by his spokeswoman.

The president called a judge who halted his controversial travel ban a "so-called judge", and said any terror attacks on US soil would be his fault.

The ban on arrivals from seven mainly Muslim countries faces a legal test.

After meeting Mr Gorsuch on Wednesday, Senator Richard Blumenthal said the Supreme Court nominee had expressed dismay at the president's criticism.

Mr Blumenthal told ABC News: "There's no question that Judge Gorsuch said that these attacks on the judiciary are disheartening and demoralising.

"You needn't believe me, there were White House staff in the room, and his own spokesman confirmed afterward what he said."

In a Thursday morning tweet, Mr Trump accused the Democratic Connecticut senator of having misrepresented his discussion with the Supreme Court nominee.

Image copyright Twitter

When asked to clarify, White House Press Secretary Sean Spicer said Judge Gorsuch was not directly referring to the president but was talking in general terms about attacks on the judiciary.

He referred to a statement by former Republican New Hampshire Senator Kelly Ayotte, who is helping Mr Gorsuch navigate Capitol Hill ahead of his confirmation hearings, as evidence that the remarks were not pointed.

She said in a statement: "Judge Gorsuch has 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.

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

Media playback is unsupported on your device Media caption President Trump's travel ban court battle explained

A federal judge in Seattle, James Robart, made headlines last week when he issued a stay on the president's refugee and immigration ban, arguing it was unconstitutional.

Mr Trump reacted by tweeting: "The opinion of this so-called judge, which essentially takes law-enforcement away from our country, is ridiculous and will be overturned!"

He also attacked the jurist several times over the weekend and on Wednesday complained that some courts were "so political".

A classic conservative dilemma - Anthony Zurcher, BBC News, Washington

Donald Trump has offered Neil Gorsuch the keys to the kingdom - a lifetime appointment to the US Supreme Court, where the 47-year-old judge would have the opportunity to make a lasting mark on American jurisprudence.

The gift comes at a price, however. Mr Gorsuch, highly regarded for his judicial temperament and sharp legal mind, is now in the uncomfortable position of having to explain why the president who nominated him seems intent on eroding the authority of the judicial branch in which he serves.

While past presidents have questioned judicial decisions, Mr Trump - with his "so-called judge" tweet and warnings of assigning blame to courts for future terrorist attacks - has made his disagreements personal.

Now we have evidence that Mr Gorsuch may not hold his tongue and play the loyal soldier. In the end, he has a reputation to protect - one that will outlive the upcoming confirmation battle.

This is the Trump dilemma for conservatives in a nutshell. The president offers Republicans the opportunity to achieve goals long delayed after eight years of Democratic rule. They may not enjoy the political journey the president takes them on to get there, however.

Democrats and other critics have said Mr Trump's comments about the judiciary undermine a core principle of US democracy that courts are supposed to be independent.

The judiciary is a co-equal branch of the US government, along with Congress and the president's executive branch, under the Constitution.

Media playback is unsupported on your device Media caption 'It gets lonely': Being conservative on a liberal campus

The 9th US Circuit Court of Appeals is pondering whether to reinstate Mr Trump's executive order on immigration.

It is expected that the case will end up in the Supreme Court, which has only eight justices until Mr Gorsuch is confirmed by the US Senate.

On Wednesday, the White House released a list of 24 terror suspects who came to the US from the seven Muslim-majority countries featured in the executive order.