A federal judge in Hawaii on Wednesday issued a sweeping freeze of President Trump’s new executive order hours before it would have temporarily barred the issuance of new visas to citizens of six Muslim-majority countries and suspended the admission of new refugees.

In a blistering 43-page opinion, U.S. District Judge Derrick K. Watson pointed to Trump’s own comments and those of his close advisers as evidence that his order was meant to discriminate against Muslims and declared there was a “strong likelihood of success” that those suing would prove the directive violated the Constitution.

Watson declared that “a reasonable, objective observer — enlightened by the specific historical context, contemporaneous public statements, and specific sequence of events leading to its issuance — would conclude that the Executive Order was issued with a purpose to disfavor a particular religion.”

He lambasted the government, in particular, for asserting that because the ban did not apply to all Muslims in the world, it could not be construed as discriminating against Muslims.

“The illogic of the Government’s contentions is palpable,” Watson wrote. “The notion that one can demonstrate animus toward any group of people only by targeting all of them at once is fundamentally flawed.”

Early Thursday, a federal judge in Maryland issued a second, narrower injunction against the measure — suspending only the portion that stopped the issuance of visas to citizens of six Muslim-majority countries. In that case, U.S. District Judge Theodore D. Chuang also pointed to statements by Trump and his advisers made that, in Chuang’s opinion, indicated the executive order was “the realization of the long-envisioned Muslim ban.”

“These statements, which include explicit, direct statements of President Trump’s animus toward Muslims and intention to impose a ban on Muslims entering the United States, present a convincing case that the First Executive Order was issued to accomplish, as nearly as possible, President Trump’s promised Muslim ban,” Chuang wrote.

At a rally in Nashville on Wednesday, Trump called the Hawaii court ruling “terrible” and asked a cheering crowd whether the ruling was “done by a judge for political reasons.” He said the administration would fight the case “as far as it needs to go,” including up to the Supreme Court, and rued that he had been persuaded to sign a “watered-down version” of his first travel ban.

“Let me tell you something, I think we ought to go back to the first one and go all the way,” Trump said. “The danger is clear, the law is clear, the need for my executive order is clear.”

Sarah Isgur Flores, a spokeswoman for the Justice Department, said in a statement: “The Department of Justice strongly disagrees with the federal district court’s ruling, which is flawed both in reasoning and in scope. The President’s Executive Order falls squarely within his lawful authority in seeking to protect our Nation’s security, and the Department will continue to defend this Executive Order in the courts.”

(Daron Taylor/The Washington Post)

Watson was one of three federal judges to hear arguments Wednesday about the ban, though he was the first to issue an opinion.

A ruling was also expected from a federal judge in Washington.

As the ruling in Hawaii was being handed down, James L. ­Robart, the federal judge in Washington state who froze Trump’s first travel ban, was hearing arguments about whether he should freeze the second. He said he did not think his first freeze was still in effect, though he did not immediately rule on whether he should issue a new one.

Watson’s decision might not be the last word. He was considering only a request for a temporary restraining order, and while that required him to assess whether challengers of the ban would ultimately succeed, his ruling is not final on that question. The Justice Department could appeal the ruling or wage a longer-term court battle before the judge in Hawaii.

Watson’s decision came in response to a lawsuit filed by Hawaii. Lawyers for the state alleged that the new entry ban, much like the old, violated the establishment clause of the First Amendment because it was essentially a Muslim ban, hurt the ability of state businesses and universities to recruit top talent, and damaged the state’s robust tourism industry.

They pointed to the case of ­Ismail Elshikh, the imam of the Muslim Association of Hawaii, whose mother-in-law’s application for an immigrant visa was still being processed. Under the new executive order, attorneys for Hawaii said, Elshikh feared that his mother-in-law, a Syrian national, would ultimately be banned from entering the United States.

[Why Hawaii says Trump’s new travel ban is still unconstitutional]

“Dr. Elshikh certainly has standing in this case. He, along with all of the Muslim residents in Hawaii, face higher hurdles to see family because of religious faith,” lawyer Colleen Roh Sinzdak said at a hearing Wednesday. “It is not merely a harm to the Muslim residents of the state of Hawaii, but also is a harm to the United States as a whole and is against the First Amendment itself.”

Elshikh is a U.S. citizen of Egyptian descent who has been a resident of Hawaii for over a decade. His wife is of Syrian descent and is also a resident of Hawaii.

Justice Department lawyers argued that Trump was well within his authority to impose the ban, which was necessary for national security, and that those challenging it had raised only speculative harms. “They bear the burden of showing irreparable harm … and there is no harm at all,” said the acting U.S. solicitor general, Jeffrey Wall, who argued on behalf of the government in Greenbelt, Md., in the morning and by phone in Hawaii in the afternoon.

Watson agreed with the state on virtually all the points. He ruled that the state had preliminarily demonstrated its universities and tourism industry would be hurt, and that harm could be traced to the executive order. He wrote that Elshikh had alleged “direct, concrete injuries to both himself and his immediate family.”

And Watson declared that the government’s assertion of the national security need for the order was “at the very least, ‘secondary to a religious objective’ of temporarily suspending the entry of Muslims.” He pointed to Trump’s own campaign trail comments and public statements by advisers as evidence.

“For instance, there is nothing ‘veiled’ about this press release: ‘Donald J. Trump is calling for a total and complete shutdown of Muslims entering the United States,’ ” Watson wrote. “Nor is there anything ‘secret’ about the Executive’s motive specific to the issuance of the Executive Order. Rudolph Giuliani explained on television how the Executive Order came to be. He said: ‘When [Mr. Trump] first announced it, he said, ‘Muslim ban.’ He called me up. He said, ‘Put a commission together. Show me the right way to do it legally.’ ”

Watson also pointed to a recent Fox News appearance by Stephen Miller, in which the president’s senior policy adviser said the new ban would have “mostly minor technical differences” from the previous iteration frozen by the courts, and Americans would see “the same basic policy outcome for the country.”

“These plainly-worded statements, made in the months leading up to and contemporaneous with the signing of the Executive Order, and, in many cases, made by the Executive himself, betray the Executive Order’s stated secular purpose,” Watson wrote.

Opponents of the ban across the country — including those who had argued against it in different cases on Wednesday — hailed Watson’s ruling.

Bob Ferguson, the Washington state attorney general who asked Robart to block the measure, called the Hawaii ruling “fantastic news.” Justin Cox, a staff attorney for the National Immigration Law Center who argued for a restraining order in the case in Maryland, said, “This is absolutely a victory and should be celebrated as such, especially because the court held that the plaintiffs, that Hawaii was likely to succeed on its establishment clause claim which essentially is that the primary purpose of the executive order is to discriminate against Muslims.”

Cox said while the judge did not halt the order entirely, he blocked the crucial sections — those halting the issuance of new visas and suspending the refu­gee program. Left intact, Cox said, were lesser-known provisions, including one that orders Homeland Security and the U.S. attorney general to publicize information about foreign nationals charged with ­terrorism-related offenses and other crimes. He said the provision seems designed to whip up fear of Muslims.

“It’s a shaming device that it’s really a dehumanizing device,” he said. “It perpetuates this myth, this damaging stereotype of Muslims as terrorists.”

Trump’s new entry ban had suspended the U.S. refugee program for 120 days and halted for 90 days the issuance of new visas to people from six Muslim-majority countries: Iran, Somalia, Sudan, Yemen, Libya and Syria. It was different from the first entry ban in that it omitted Iraq from the list of affected countries, did not affect current visa or green-card holders and spelled out a robust list of people who might be able to apply for exceptions.

The administration could have defended the first ban in court — though it chose instead to rewrite the president’s executive order in such a way that it might be more defensible. The next step might have been to persuade the U.S. Court of Appeals for the 9th Circuit to rehear the case en banc, after a three-judge panel with the court upheld the freeze on Trump’s ban.

Hawaii is a part of the 9th Circuit, so the legal road could pass through the appeals court there again. Perhaps previewing the contentious fight ahead, five of the circuit’s judges on Wednesday signed a dissenting opinion in the case over the original travel ban, declaring Trump’s decision to issue the executive order was “well within the powers of the presidency.” The judges wanted to wipe out a ruling by a three-judge panel declaring otherwise.

“Above all, in a democracy, we have the duty to preserve the liberty of the people by keeping the enormous powers of the national government separated,” Judge Jay S. Bybee wrote for the dissenters. “We are judges, not Platonic Guardians. It is our duty to say what the law is, and the meta-source of our law, the U.S. Constitution, commits the power to make foreign policy, including the decisions to permit or forbid entry into the United States, to the President and Congress.”

The dissent was signed by Judges Bybee, Sandra S. Ikuta, Consuelo M. Callahan and Carlos T. Bea, who all were appointed by President George W. Bush; and Judge Alex Kozinski, who was appointed by President Ronald Reagan. It seemed to represent a minority view. The circuit has 25 active judges, and the court said a majority had not voted in favor of reconsidering the three-judge panel’s published opinion to keep Trump’s first ban frozen.

That opinion was signed by Judges Michelle T. Friedland, who was appointed by President Obama; Richard R. Clifton, who was appointed by President George W. Bush; and Judge William C. Canby Jr., who was appointed by President Carter.

Judge Stephen Reinhardt, also a Carter appointee, formally joined their opinion Wednesday and remarked that only a “small number” of 9th Circuit judges wanted to overturn it.

Takase reported from Honolulu. Lornet Turnbull in Seattle contributed to this report.