President Donald Trump has attacked a US court for halting what he called a "watered-down version" of his travel ban.

Mr Trump told supporters a district judge in Hawaii had halted his order, which temporarily suspends the US refugee programme and bars the entry of people from certain Muslim-majority countries.

The president told the campaign-style rally in Nashville, Tennessee, that the ruling is "unprecedented judicial overreach" and "makes us look weak".

READ MORE: New figures reveal over-50s are the fastest growing part of workforce

He said he is going to fight the decision and take it all the way to the Supreme Court, if necessary.

The president told the rally: "We're going to win. We're going to keep our citizens safe.

"The danger is clear. The law is clear. The need for my executive order is clear."

US District Judge Derrick Watson put the revised travel ban on hold hours before it was due to take effect.

He questioned whether the administration was motivated by national security concerns, and said Hawaii would suffer financially if the executive order blocked the flow of students and tourists to the state.

The judge concluded that Hawaii was likely to succeed on a claim that the ban violates First Amendment protections against religious discrimination.

"The illogic of the government's contentions is palpable," he wrote.

"The notion that one can demonstrate animus toward any group of people only by targeting all of them at once is fundamentally flawed."

He made it clear that his decision applied nationwide, ruling the ban could not be enforced at any US borders or ports of entry or in issuing visas.

The judge issued his 43-page ruling less than two hours after hearing Hawaii's request for a temporary restraining order to stop the ban from being put into practice.

The ruling came as opponents renewed their legal challenges across the country, asking judges in two other states to block the executive order that targets people from six predominantly Muslim countries.

Federal courts in Maryland and Washington state also heard arguments on Wednesday about whether it should be allowed to take effect early on Thursday as scheduled.

In all, more than half a dozen states are trying to stop the ban.

This is the second time that the courts have thwarted Mr Trump's efforts to freeze immigration by refugees and citizens of some predominantly Muslim nations.

His initial travel ban, issued on a Friday in late January, brought chaos and protests to airports around the country.

Travellers from seven nations - Somalia, Iran, Iraq, Syria, Sudan, Libya and Yemen - were barred from entering even if they had prior permission to come to the US.

READ MORE: New figures reveal over-50s are the fastest growing part of workforce

The State Department cancelled up to 60,000 visas, but later reversed that decision.

The administration subsequently rewrote the ban, emphasising more of a national security rationale and dropping Iraq from the list of banned countries.

It also listed some reasons that travellers from the listed nations might be granted waivers allowing them into the US despite the policy.

The new ban does not apply to travellers who already have visas.