The Post's Matt Zapotosky explains why a federal judge in Hawaii on March 15 ruled to freeze President Trump's second travel ban hours before it went into effect. (Bastien Inzaurralde/The Washington Post)

Going into the latest court battle over President Trump’s revised travel ban, government lawyers were well aware that the administration’s incendiary — many say bigoted — rhetoric about Muslims would be a liability.

Before the initial executive order was even issued, opponents had pulled together a list of public statements by Trump and his surrogates calling for a “Muslim ban” and blaming Islam for the nation’s problems. The states that challenged the order in court did the same, saying the remarks were evidence that the administration intended to discriminate against Muslims.

In response, the government’s lawyers asked a federal judge to, effectively, look the other way. Instead of focusing on Trump’s past remarks, they argued, the judge should only consider the plain language of the revised order in deciding whether it violated the Constitution.

But in his blistering opinion Wednesday freezing the new travel ban, U.S. District Judge Derrick K. Watson said statements by Trump and his senior advisers were precisely what called its legality into question.

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

And early Thursday morning, a federal judge ruling in a related case in Maryland said the order was “the realization of the long-envisioned Muslim ban,” as The Washington Post reported. Though U.S. District Judge Theodore D. Chuang’s opinion was narrower in scope than Watson’s, he still found room to take aim at statements by Trump and his advisers, saying they showed “animus toward Muslims and intention to impose a ban on Muslims entering the United States.”

In short, Trump’s loose talk had come back to bite him yet again. Only this time the criticism was coming straight from federal judges.

Watson’s opinion was remarkable given that other judges who have ruled on the travel ban have stopped short of saying that the Trump administration’s statements showed discriminatory intent, according to Mary Fan, an immigration and refugee law professor at the University of Washington School of Law.

“The judge actually tackled the big elephant in the room, which has drawn so much consternation,” Fan said.

Indeed, as legal challenges to the ban advance, the Trump administration’s rhetoric may become the albatross the government can’t shake.

“The history and the many, many statements from Trump and his senior advisers will haunt this travel ban however long the language of it evolves,” Fan said. “You can’t rewrite history, all the many quotes and tweets that are already out there.”

In his opinion, which came in response to a lawsuit by the state of Hawaii, Watson said Trump’s remarks on the campaign trail, along with commentary from his advisers, amounted to “significant and unrebutted evidence of religious animus.”

The judge pointed to a March 2016 interview then-candidate Trump gave on CNN, in which he said “I think Islam hates us.”

“We can’t allow people coming into this country who have this hatred of the United States,” Trump said in the interview, “and of people that are not Muslim.”

Watson also cited a July 2016 interview in which Trump said changes to his proposed ban really amounted to “an expansion,” and a moment in the Oct. 9 presidential debate when Trump suggested the “Muslim ban” had morphed into “extreme vetting.”

Trump’s original travel ban, issued in January, sought to shut U.S. borders to refugees and migrants from seven mostly Muslim countries. The revised ban, issued in February, seeks to bar new visas for people from six Muslim-majority countries and suspends the admission of new refugees.

The U.S. Court of Appeals for the 9th Circuit halted the original order shortly after Trump signed it. In its ruling, the court didn’t take a stance on whether the order discriminated against Muslims, but noted that the states of Washington and Minnesota had “offered evidence of numerous statements by the President about his intent to implement a ‘Muslim ban’ as well as evidence they claim suggests that the Executive Order was intended to be that ban.”

Bracing for those claims to come up again in litigation over the revised order, government lawyers argued that it wasn’t Watson’s job to investigate the “veiled psyche” and “secret motives” of policymakers. Nor should the judge undertake a “judicial psychoanalysis of a drafter’s heart of hearts,” they said.

“Government need not fear,” the judge responded in his opinion. “The remarkable facts at issue here require no such impermissible inquiry. 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.’ ”

Nor was there anything secret about the White House’s motive, according to the judge.

The opinion read: “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.’ ”

Another example, Watson wrote, came in a Feb. 21 interview senior policy adviser Stephen Miller granted Fox News. In it, Miller said the revised ban would contain “mostly minor technical differences” from the original, and would result in “the same basic policy outcome for the country.”

“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,” Watson wrote.

Responding to the ruling Wednesday evening, Trump said the administration would fight the case all the way to the U.S. Supreme Court if necessary. He questioned whether the opinion was politically motivated and lamented that he had been pressured to sign a “watered-down version” of his original travel ban.

His remarks, delivered at a rally in Nashville, may not do him any favors as the litigation moves forward.

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

More from Morning Mix:

Trump adviser Roger Stone said he was a victim in Florida hit-and-run, possibly ‘deliberate’

Did Trump have his own tax return leaked? That was the big question after Maddow.

Snow forces two congressmen on a bipartisan road trip from Texas to D.C. — singing along the way