We’ve seen the fallout that a single tweet from President Trump can generate, including a stock price drop for companies he has attacked on Twitter. But in what could be a first, his tweets about a ban on Muslims traveling to the U.S. may have helped convince the 9th U.S. Circuit Court of Appeals to stay his executive order on immigration.
Trump’s order—which would freeze immigration from seven predominantly Muslim countries, including Iran and Syria—went into effect after it was signed on January 27, but was challenged by several states. The order was stayed by a judge, and the Justice Department appealed to the 9th Circuit, which upheld the stay on Thursday.
The judges considered a number of issues relating to the order, including whether or not the judiciary has the right to overrule executive branch decisions when it comes to immigration policy. (They decided that it does.)
But the main thing the 9th Circuit considered was whether the states had a strong likelihood of succeeding with their case that the order was unconstitutional because it targeted a specific group based on their religion. The court decided there was likely enough evidence to challenge the order on those grounds—and part of that evidence was tweets and other statements made by Trump and his administration.
As Benjamin Wittes put it in a discussion of the 9th Circuit decision on the national security and legal analysis blog Lawfare, the court looked at “the extent to which the repeated and overt invocations of the most invidious motivations on the part of the President himself, his campaign, his adviser, and his Twitter feed” made what would have otherwise been a valid exercise of his power invalid.
In other words, the court said that while signing an executive order covering immigration is something that the president is allowed to do, his statements and those of his administration raise the possibility that it was designed to be a “Muslim ban,” which is unconstitutional.
Get Data Sheet, Fortune’s technology newsletter.
Trump mentioned the idea of a ban on Muslim immigration throughout his campaign, as well as a number of other potential moves that he planned to take, including a Muslim registry of some kind. And since the election, Trump adviser Rudy Giuliani has talked about how he was asked by the president to come up with a way to implement a “Muslim ban” legally.
The ACLU in California has also sued to try and stop the executive order, and its lawsuit specifically mentions a number of tweets that Trump posted about Muslim immigration, including one during the campaign that mentioned his plan for a ban.
Although the 9th Circuit said that Trump’s comments, speeches, and other public statements provided enough evidence to make the argument that his order was unconstitutional, not everyone agrees that taking someone’s speeches and tweets from long before they were president as evidence of their motives is strictly fair.
Lawyer Eugene Kontorovich, for example, wrote about the appeals court’s decision, describing its use of such statements “dangerous and unprecedented.” There is no precedent, he said, for courts “looking to a politician’s statements from before he or she took office, let alone campaign promises, to establish any kind of impermissible motive.”
The risk of doing so, Kontorovich argued, is that campaign promises are often insincere, designed simply to get votes, and that shouldn’t be taken as evidence of what a candidate will do when it comes to actual legislation once they become president. Doing so, he continued, would also cast an unreasonable chill over campaign speech.
The 9th Circuit clearly disagrees. And now Trump’s tweets and other statements about the idea of a Muslim ban have torpedoed (for now at least) his legislative attempts to implement that ban.