Donald Trump. Pool/Getty Images One of President Donald Trump's recent tweets about his administration's controversial travel ban was used against him in the 9th US Circuit Court of Appeals' decision on Monday to uphold an injunction blocking the implementation of the executive order.

The three-judge panel, which ruled unanimously against the Trump administration's request to lift the injunction, included Trump's June 5 tweet in its ruling.

"That's right, we need a TRAVEL BAN for certain DANGEROUS countries, not some politically correct term that won't help us protect our people!" Trump had tweeted in response to the terror attack in London.

The court wrote that Trump's tweet showed he believed it was the countries, not their 180 million citizens, that were "inherently dangerous." The 9th Circuit's ruling said there were two incidents in which former presidents had "distinguished classes of aliens on the basis of nationality."

"But these distinctions were made not because of a particular concern that entry of the individuals themselves would be detrimental, but rather, as retaliatory diplomatic measures responsive to government conduct directed at the United States," the judges wrote. "For example, President Carter's proclamation barring the future entry of Iranians occurred during the exigent circumstance of the Iranian hostage crisis. This was one of many sanctions imposed to increase political pressure on the Iranian government to ensure the safe return of American hostages.

"President Reagan's suspension of entry of certain Cuban nationals as immigrants came as a response to the Cuban government's own suspension of 'all types of procedures regarding the execution' of an immigration agreement between the United States and Cuba, which had 'disrupt[ed] normal migration procedures between the two countries.'"

The judges also cited White House press secretary Sean Spicer's recent confirmation that Trump's tweets are "considered official statements by the president of the United States" to help back up their ruling.

Defenders of the travel ban expressed concern with Trump's tweets ahead of the 9th Circuit's ruling. George Conway, a prominent lawyer and the husband of top Trump adviser Kellyanne Conway, said last week that Trump's tweets "may make some ppl feel better" but wouldn't help the solicitor general's office win the case at the Supreme Court, "which is what actually matters."

"Sad," he added.

The lawyer, who recently withdrew himself from consideration for a top Justice Department post, launched into a tweetstorm explaining his views and clarifying that he "VERY, VERY STRONGLY" supports Trump, his administration, policies, the executive order itself, "and of course, my wonderful wife."

"Which is why I said what I said this morning," he wrote. He said "every sensible lawyer" in the White House counsel's office and "every political appointee at DOJ" would agree with him, "as some have already told me."

He added that the point "cannot be stressed enough that tweets on legal matters seriously undermine Admin agenda and POTUS — and those who support him, as I do, need to reinforce that pt and not be shy about it."

And Alan Dershowitz, a Harvard law professor and prolific attorney who has repeatedly defended the legality of the executive order, said Trump's tweets were "not helping" his cause.

"I think there are people in the White House — wouldn't be surprised if [Kellyanne] Conway is one of them — who are trying everything to try and get him to stop tweeting," he told Business Insider, pointing to George Conway's message as one "that gets to" Trump.

"At least one would think so," he added. "Because they have to be trying their best to stop this. And so far, they haven't succeeded."

The 9th Circuit ruled Monday that Trump "exceeded the scope of the authority delegated to him by Congress" to oversee immigration in his revised executive order, which would bar citizens of six Middle Eastern and African nations from entering the US for 90 days, unless the citizen already had a valid visa, as well as all refugees for 120 days.

Those periods were intended to be time for the administration to review its vetting process and possibly revise its practices, although it's unclear why it couldn't have completed that review during the more than 140 days Trump has been president.

"Immigration, even for the president, is not a one-person show," the judges wrote in their opinion.

In May, the 4th US Circuit Court of Appeals also shut down the Trump administration's effort to enact the executive order. The administration has since appealed to the Supreme Court to allow the travel ban to take effect.