WASHINGTON ― President Donald Trump’s tweets have yet again hurt him in court.

The U.S. Court of Appeals for the 9th Circuit on Monday upheld a block on Trump’s executive order that sought a 90-day travel ban to the U.S. for most nationals of six Muslim-majority nations and to suspend all refugee resettlement for 120 days.

In doing so, the court cited one of Trump’s tweets ― and the fact that the White House acknowledged last week that they can be considered “official statements” of the administration.

“[T]he President recently confirmed his assessment that it is the ‘countries’ that are inherently dangerous, rather than the 180 million individual nationals of those countries who are barred from entry under the President’s ‘travel ban,’” the ruling says.

The judges then quoted a tweet from Trump on June 5, which said the U.S. needs “a TRAVEL BAN for certain DANGEROUS countries, not some politically correct term that won’t help us protect our people!”

The ruling said that Trump’s order “does not provide a rationale explaining why permitting entry of nationals from the six designated countries under current protocols would be detrimental to the interests of the United States.”

It also says the order “does not tie these nationals in any way to terrorist organizations within the six designated countries. It does not identify these nationals as contributors to active conflict or as those responsible for insecure country conditions. It does not provide any link between an individual’s nationality and their propensity to commit terrorism or their inherent dangerousness.”

Trump and the Department of Justice have claimed he has every right to temporarily suspend entry by certain foreign nationals and refugees, and claimed it has nothing to do with the “Muslim ban” he proposed as a candidate. 

But Trump’s words have been cited in court multiple times as evidence that the order is based, at least in part, on religious animus, which was part of the U.S. Court of Appeals for the 4th Circuit’s opinion smacking down the the order in May.

Both that ruling and today’s 9th Circuit opinion are likely to go before the Supreme Court.

White House Press Secretary Sean Spicer said Monday the administration is reviewing today’s opinion but stands behind the executive order.

“I think we can all attest that these are very dangerous times and we need every available tool at our disposal to prevent terrorists from entering the United States and committing acts of bloodshed and violence,” he said. “We continue to be confident that the president’s executive order to protect this country is fully lawful and ultimately will be upheld by the Supreme Court.”