Just hours before President Donald Trump's revised travel ban was set to go into effect, a US federal judge in Hawaii on Wednesday issued an emergency halt to the order's implementation.
The action was the latest legal blow to the administration's efforts to temporarily ban refugees as well as travelers from six predominantly Muslim countries.
The new ban, signed by the president on March 6, had aimed to overcome legal problems with a January executive order that caused chaos at airports and sparked mass protests before a Washington judge stopped its enforcement in February.
US District Judge Derrick Watson put an emergency stop to the new order in response to a lawsuit filed by the state of Hawaii, which argued that the order discriminated against Muslims in violation of the US Constitution. President Trump has said the policy is critical for national security and does not discriminate against any religion.
Judge Watson concluded in his ruling that while the order did not mention Islam by name, "a reasonable, objective observer ... would conclude that the Executive Order was issued with a purpose to disfavor a particular religion." Watson was appointed to the bench by former Democratic President Barack Obama.
Trump said the judge's legal block "makes us look weak" and represented "unprecedented judicial overreach," speaking at a rally in Nashville, Tennessee. He said he'll take case "as far as it needs to go" including to the Supreme Court.
Paul Ryan, the Republican Speaker of the US House of Representatives, said the ban was needed to improve vetting of people entering the United States and he had no doubt that it would be upheld by higher courts.
The legal battle is likely to move now to the federal appeals circuit and could eventually get to the US Supreme Court.
Watch: Hawaii Attorney-General Doug Chin on the new travel ban
Rebuke
Hawaii and other opponents of the ban claimed that the motivation behind it was Trump's campaign promise of "a total and complete shutdown of Muslims entering the United States."
Trump later toned down that language and said he would implement a policy of "extreme vetting" of foreigners coming to the United States.
Watson's order is only temporary until the broader arguments in the case can be heard. He set an expedited hearing to determine if his ruling should be extended.
Trump's first travel order was more sweeping than the second revised order. Like the current one, it barred citizens of Iran, Libya, Syria, Somalia, Sudan and Yemen from entering the country for 90 days, but it also included Iraq, which was taken off the list of banned countries in the subsequent order.
Refugees were blocked from entering the country for 120 days in both orders, but an indefinite ban on all refugees from Syria was dropped in the new one.
Related reading
Trump earned $153m and paid $36.5m in tax
The revised ban also excluded legal permanent residents and existing visa holders. It provided a series of waivers for various categories of immigrants with ties to the United States.
The government has maintained in court that the changes resolve any legal issues with the original order and maintained that it was not discriminatory.
The government, in its court filings cautioned the court against looking for secret motives in the executive order and against performing "judicial psychoanalysis of a drafter’s heart of heart."
Watson said he did not need to do that, because evidence of motive could be found in the president's public statements. He said he did not give credence to the government's argument that the order was not anti-Muslim because it targeted only a small percentage of Muslim-majority countries.
"The notion that one can demonstrate animus toward any group of people only by targeting all of them at once is fundamentally flawed," the judge wrote.
Watch: Trump condemns court's decision to block travel ban
Several cases
The case was one of several moving through US courts on Wednesday that were brought by states' attorneys general and immigrant advocacy groups.
In Maryland, refugee resettlement agencies represented by the American Civil Liberties Union and the National Immigration Law Center argued in court for a restraining order.
In Washington state, a group of plaintiffs applying for immigrant visas asked US District Judge James Robart in Seattle - who suspended the first ban - to stop the new order. Robart was appointed to the bench by Republican President George W Bush.
Washington state, joined by California, Maryland, Massachusetts, New York and Oregon, said in court filings they supported the plaintiffs in Seattle.
Various groups and companies said they would be harmed by the travel restrictions.
A group of 58 tech companies, including Airbnb, Lyft and Dropbox, filed a "friend of the court' brief in the case saying the order hurt their ability to recruit the best talent from around the world. A longer list of companies - that included giants like Apple, Facebook and Alphabet Inc's Google - filed a brief opposing the first ban in a different court challenge brought by Washington state, which is ongoing.
Both judge Robart and US District Judge Theodore Chuang said they would issue written rulings in their cases, but did not specify a time line.
If more judges side with Watson, the government's case may be harder to make at higher courts. The 9th Circuit US Court of Appeals upheld Robart's ruling against the first ban and Watson referenced that decision in his order.