President Trump’s long history of stretching the truth and speaking hyperbolically has hurt his credibility with the American public. But in court, he’s had the opposite problem.

Judges are taking him at his word.

In temporarily striking down Trump’s order threatening to strip funding from “sanctuary cities,” a federal judge this week in San Francisco used the president’s own comments against him. That in itself was not unusual since judges had done the same thing in blocking Trump’s travel ban.

What was curious was the Justice Department’s argument: Trump’s statements and the order itself should be taken as mere use of the “bully pulpit” — rather than specific policies that should be acted upon.

“This case is fascinating and, in some ways hilarious, in a weird, Catch-22 kind of way,” said Rick Su, law professor at the University at Buffalo School of Law specializing in immigration and local government. “If you take the Department of Justice at their word, then there should be no need for the executive order. . . . You’re essentially saying that the president signed a document which is meant to do nothing.”

[Trump and his advisers can’t keep quiet — and it’s becoming a real problem]

Trump advisers have in the past cautioned against reading too much into the president’s spontaneous remarks. Adviser Anthony Scaramucci remarked to MSNBC last year, “Don’t take him literally, take him symbolically.” Rep. Devin Nunes (R-Calif.), commenting on the president’s evidence-free claim that President Barack Obama had ordered a wiretap on Trump Tower, noted that Trump is a “neophyte” to politics and urged caution in interpreting his tweets literally.

At issue in the sanctuary cities case is whether the president had gone too far in issuing an executive order threatening to strip federal funds from jurisdictions that did not cooperate with immigration authorities.

The order was vague, but some cities interpreted its consequences as dire. They feared that if they did not hold illegal immigrants in their jails upon federal request, that would jeopardize the millions of dollars they received from the federal government.

San Francisco and the County of Santa Clara in California sued to have the directive stopped, arguing that even the threat was having serious repercussions on their budgetary decisions.

“The fear on the part of local jurisdictions across the country and also in California, by the way, was palpable,” said Santa Clara County Counsel James Williams. “People absolutely viewed it as a serious threat. Entities were busy trying to figure out what funding might be at risk.”

In Miami Dade County in Florida, officials reversed a policy not to hold suspected illegal immigrants on behalf of Immigration and Customs Enforcement — fearing a loss of federal funds. In Lansing, Mich., officials who had previously declared themselves a “sanctuary city” undid that move.

In court, the Justice Department said that the threat did not go as far as some feared it would.

Acting Assistant Attorney General Chad Readler argued that, at most, the order threatened only a few, particular federal grants — not all federal financial support that cities receive. He noted that the order referenced a particular federal law about communication with immigration authorities, and the previous administration had actually identified jurisdictions possibly out of compliance with that law.

Readler said the federal government had “acknowledged repeatedly” requests of local jails to hold suspected illegal immigrants were “not mandatory.”

Pressed by U.S. District Judge William H. Orrick on what, then, was the purpose of the executive order, Readler said it was to “highlight” the issue to the country.

“Executives do this all the time to highlight issues they care about,” he said. He added later, “Other than this very heated and joined political dispute about what proper immigration policy should be, there’s no actual enforcement action on the table or that’s even been — even been formally threatened to the city.”

Readler did offer that enforcement actions “may well come in the future.”

In blocking the order, Orrick essentially said he didn’t believe what the Justice Department was arguing, and that Trump should be taken at his word. The president, Orrick wrote, had declared on Fox News that he could use defunding of sanctuary cities as a “weapon,” and his order was so vague about who might be targeted that cities “do not know whether they should start slashing essential programs or continue to spend millions of dollars and risk a financial crisis in the near future.”

Orrick also referenced comments Attorney General Jeff Sessions made at a White House news briefing. There, Sessions said the Justice Department would “take all lawful steps to claw back any funds awarded to a jurisdiction that willfully violates” one, particular federal law.

[Fact Checker: The White House’s claim that ‘sanctuary’ cities are violating the law]

Orrick curiously said Sessions could still enforce that law — which bars places from blocking communication with Immigration and Customs Enforcement — and it could hold back grant money that came with immigration-related strings attached.

Williams said — even with those caveats — Orrick’s order was significant because “what the executive order itself was threatening was to withhold all of our federal funding.”

“That’s actually the threat that the president himself was making,” Williams said. “The reality is when the president of the United States makes threats, people cannot afford to not take that seriously. The words do have meaning.”

In an interview on CBS Friday morning, Sessions said he felt using the president’s comments — particularly those made during the campaign — was inappropriate.

“Judges just don’t get to say, ‘Well, you said in the campaign nine months ago, so I don’t like this order,’ ” he said. “So, the question is: Is the order itself improper, does it in any way improperly discriminate or does it advance the safety of America?”

For its part, the White House lambasted Orrick’s decision in a statement as an “egregious overreach by a single, unelected district judge” and cast the dispute as a “fight between sovereignty and open borders, between the rule of law and lawlessness, and between hardworking Americans and those who would undermine their safety and freedom.”

And, somewhat contrary to what the Justice Department had argued, they seemed to confirm that San Francisco was firmly in the crosshairs to lose money.

“Sanctuary cities, like San Francisco, block their jails from turning over criminal aliens to Federal authorities for deportation,” the White House statement said. “These cities are engaged in the dangerous and unlawful nullification of Federal law in an attempt to erase our borders.”