A federal court in Hawaii on Wednesday halted Donald Trump's revised executive order temporarily closing US borders to refugees and nationals from six Muslim-majority countries, dealing the president a humiliating fresh defeat.

US District Judge Derrick Watson ruled that the state of Hawaii, in its legal challenge to the order, had established a strong likelihood that the ban would cause "irreparable injury" were it to go ahead.

The court in Honolulu was the first to rule in a trio of legal challenges against the ban, which had been set to go into effect at midnight.

Decisions were expected later Wednesday from federal courts in Washington state and Maryland.

The ruling means a nationwide freeze on enforcement of section two of the order, banning entry by nationals of Iran, Libya, Somalia, Sudan, Syria and Yemen for 90 days.

It also halts section six, which would have suspended the US refugee admissions program for 120 days.

Trump quickly vowed to fight the "flawed" ruling all the way to the Supreme Court if required, describing it as "unprecedented judicial overreach."

"The law in the constitution gave the president the power to suspend immigration when he deems it to be in the national interest of our country," he said at a speech in Nashville, Tennessee, adding: "We are going to win."

The Hawaii court said however it would not stay its decision in the event of an appeal, meaning the ban cannot go ahead as planned on Thursday regardless of any action the White House takes.

A decision in the other two courts to support the ban cannot overturn the decision in Hawaii, which would need to be challenged in an appeals court.

Trump signed a revised ban behind closed doors on March 6 with a reduced scope, exempting Iraqis and permanent US residents but maintaining the temporary ban on the other six countries and refugees.

The White House said those six countries were targeted because their screening and information capabilities could not meet US security requirements.

But Watson rejected the White House claim that the order wasn't a Muslim ban, ruling that it would not be a leap "to conclude that targeting these countries likewise targets Islam," because their Muslim populations range from 90.7 percent to 99.8 percent.

The judge made reference to several examples of Trump explicitly framing proposed action on immigration in religious language, including a March 2016 interview during which the then president-elect said: "I think Islam hates us."

"Mr. Trump was asked, 'Is there a war between the West and radical Islam, or between the West and Islam itself?' He replied: 'It's very hard to separate. Because you don't know who's who,'" the judge added.

In Greenbelt, Maryland, Judge Theodore Chuang was expected to rule on a complaint filed by a coalition of advocacy groups that the amended order discriminates against Muslims.

"In his mind, the danger of Muslims and the danger of refugees is all combined danger," Omar Jadwat, a lawyer for the American Civil Liberties Union, said of the president.

We are pleased but not surprised by this latest development and will continue working to ensure the Muslim ban never takes effect.

The group said it was "pleased but not surprised" by the Hawaii ruling, while New York Attorney General Eric T. Schneiderman hailed the decision as "yet another victory for the Constitution and the rule of law."

The first version of Trump's order triggered protests at home and abroad as well as chaos at US airports as people were detained upon arrival and either held for hours or sent back to where they came from.

The Trump administration narrowed the restrictions in its revised order to try to ensure it would be unassailable this time around.

"This order doesn't draw any religious distinction at all," said Jeffrey Wall, a government attorney.

Questioned about Trump's tweets and statements during the presidential campaign in which he promised to enact a "Muslim ban," Wall said: "There is a difference between a president and a candidate."

Coast to coast

But critics say the new order essentially remains a ban on Muslims coming to the United States, and therefore unconstitutional because it singles out followers of a certain religion for discrimination.

Since September 11, 2001, the worst attacks in the United States have been committed either by radicalized Americans or by people from countries not on the Trump travel ban list.

Critics also argue that it will have a very negative effect on schools, universities and the business world, mainly the high tech sector, which employs many highly skilled immigrants.

The state of Washington, joined by five other states, filed a complaint Monday with the same Seattle judge who stayed Trump's original travel ban in February.

Trump responded by insulting that federal magistrate, James Robart, calling him a "so-called judge."

Robart will oversee the Washington state hearing on Wednesday and he could once again suspend all or part of the new order.