White House reworked the first executive order to address some of the issues that came up in court.

President Donald Trump insists his amended travel ban will survive any legal challenge and it's time to see if he's right, with the first court hearings on it scheduled for Wednesday.

“SEE YOU IN COURT,” Mr. Trump tweeted after his first executive order on immigration was stayed by a judge on February 3.

It would seem people have taken him at his word, given the number of complaints — by states and rights groups — filed against his travel ban. The new iteration is supposed to take effect Thursday.

It bars all refugees from entering the US for 120 days and halts the granting of new visas for travellers from six mostly-Muslim nations: Iran, Libya, Somalia, Sudan, Syria and Yemen for 90 days. Iraq was dropped from the initial list.

Two federal courts, one in Hawaii and another in Maryland, have scheduled hearings for Wednesday on the new measure, the most controversial of Trump's young administration. A hearing could also come as soon as Wednesday in a third challenge filed by six US states.

The White House reworked the first executive order to address some of the issues that came up in court. The revised order explicitly exempts holders of valid visas or legal permanent residents, for instance.

But the main points are largely the same.

The first version of the order, which Trump signed on January 27, triggered howls of protest 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 White House was roundly attacked for what critics said was a hasty rollout and a glaring lack of coordination with the agencies tasked with enforcing the ban.

'Vital' decree

In recent days the president and his leading cabinet members — Secretary of State Rex Tillerson, Attorney General Jeff Sessions and John Kelly, the homeland security secretary — have defended the new order as a vital tool to preserve US national security and keep out extremists.

But critics say the order essentially remains a ban on Muslims and therefore unconstitutional as it singles out people of a certain religion for discriminatory treatment.

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

Critics argue that, even though the new order exempts holders of valid visas and permanent residents with so-called green cards, it will have a very negative effect on schools and universities and the business world, mainly the high tech sector, which employs many highly skilled immigrants.

The new battle against Trump's order is being played out on several geographical fronts, but mainly on the west coast, which tends to be heavily pro-Democrat.

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 back in February.

Mr. Trump had responded by insulting the federal magistrate, James Robart, calling him a “so-called judge.”

Under the US legal system, a federal judge can suspend all or part of the Trump executive order, with nationwide effect — which Robart did the first time around and which the state plaintiffs hope he will do again.

"The Trump administration may have changed the text of the now-discredited Muslim travel ban, but they didn't change its unconstitutional intent and effect," California Attorney General Xavier Becerra wrote. The other states joining Washington in its lawsuit are Massachusetts, Oregon, Maryland and New York.

Nationwide impact

Judge Robart has ordered the government to respond to the arguments put forward by the six states by late Tuesday, and said a new hearing would take place Wednesday at the earliest.

Hawaii has also filed its own, separate complaint against the order, with a hearing set for Wednesday.

And several rights and refugee advocacy groups, including the American Civil Liberties Union, have filed papers with a judge in Maryland. There, too, a hearing with both sides in the case is set for Wednesday morning.

Justice Department lawyers are ready to do battle to defend the new Trump order in court.

In Hawaii, the government filed a motion opposing the state's request for an injunction, saying the travel ban is "a valid exercise of the president's broad statutory authority to 'suspend the entry of any aliens or of any class of aliens.'"

The new order hit its first roadblock Friday when a judge in Wisconsin said it could not be applied to the wife and child of a Syrian refugee who had already reached America.