Donald Trump has suffered the biggest defeat of his short presidency as a court refused to reinstate his executive order banning refugees and restricting travel to the United States from seven Muslim-majority countries.
Federal and local law enforcement agencies have increased protection for the judges involved, amid threats against more than one of them, as tensions run high over the decision.
Furious at the unanimous decision by a panel of three judges to uphold the halt placed on his travel ban, Mr Trump indicated he would now make good on a pledge to take the case to the Supreme Court.
“See you in court, the security of our nation is at stake!” he tweeted in capital letters.
In response, Washington Gov. Jay Inslee, a Democrat who leads one of the states that challenged the ban, said: “Mr. President, we just saw you in court, and we beat you.”
In the 29-page ruling, the judges at the San Francisco court of appeals said the government had failed to provide enough evidence that urgently implementing the ban was necessarily for the country’s security.
The appellate judges noted compelling public interests on both sides.
“On the one hand, the public has a powerful interest in national security and in the ability of an elected president to enact policies. And on the other, the public also has an interest in free flow of travel, in avoiding separation of families, and in freedom from discrimination.”
Mr Trump told reporters his administration ultimately would win the case and dismissed the ruling as “political.”
The Justice Department said it was “reviewing the decision and considering its options.” It was the first day on the job for new Attorney General Jeff Sessions, who was sworn in at the White House earlier on Thursday by Vice President Mike Pence.
Mr Trump had said he would blame the country’s judiciary for any terrorist attacks on US soil while the ban was blocked, and publicly belittled the judge responsible for blocking it.
The US president said “bad and dangerous people” were “pouring” across the border as a result of the judge’s decision, and pledged that it would be quickly reversed.