HONOLULU/NEW YORK (Reuters) - Just hours before President Donald Trump’s revised travel ban was set to go into effect, a U.S. 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, which the President has said is needed for national security. Trump lashed out at the judge’s ruling, saying it “makes us look weak.”

Trump signed the new ban on March 6 in a bid 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.

U.S. 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 U.S. Constitution.

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.

Speaking at a rally in Nashville, Trump called his revised executive order a “watered-down version” of his first. “I think we ought to go back to the first one and go all the way, which is what I wanted to do in the first place,” Trump said.

Trump called the judge’s block “unprecedented judicial overreach” and said he will take the case “as far as it needs to go,” including to the U.S. Supreme Court.

The Department of Justice called the ruling “flawed both in reasoning and in scope,” adding that the president has broad authority in national security matters. “The Department will continue to defend this Executive Order in the courts,” it said a statement.

The nation’s highest court is currently split 4-4 between liberals and conservatives with Trump’s pick - appeals court judge Neil Gorsuch - still awaiting confirmation.

Slideshow ( 4 images )

Paul Ryan, the Republican Speaker of the U.S. House of Representatives, said the ban was needed to improve vetting of people entering the United States in order to prevent attacks and said he had no doubt that it would be upheld by higher courts.

REBUKE

Watson’s order is only temporary until the broader arguments in the case can be heard. He set an expedited hearing schedule 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 subsequently taken off the list.

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.

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.

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.”

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.”

Slideshow ( 4 images )

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.

SEVERAL CASES

The case was one of several moving through U.S. 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 U.S. District Judge James Robart in Seattle - who suspended the first ban - to stop the new order. Robart was appointed to the bench by Republican former President George W. Bush.

Both Judge Robart and U.S. District Judge Theodore Chuang in Maryland said they would issue written rulings in their cases, but did not specify a time line.

Washington state, joined by California, Maryland, Massachusetts, New York and Oregon, said in court filings they supported the plaintiffs in Seattle.

If more judges side with Watson, the government’s case may be harder to make at higher courts. The 9th Circuit U.S. Court of Appeals upheld Robart’s ruling against the first ban and Watson referenced that decision in his order.

Various groups and companies said they would be harmed by the travel restrictions.

A group of 58 technology companies, including Airbnb Inc, Lyft Inc and Dropbox Inc, 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, including Apple Inc , Facebook Inc and Alphabet Inc’s Google - filed a brief opposing the first ban in a different court challenge brought by Washington state, which is ongoing.

It was not immediately clear why fewer tech companies signed on to the brief this time around.