A US court unanimously refused to reinstate Donald Trump's ban on refugees and nationals from seven Muslim-majority countries, dealing the new president and his controversial law-and-order agenda a major defeat.
The San Francisco federal appeals court's ruling on Trump's executive order — issued on January 27 with no prior warning and suspended by a lower court a week later — capped a turbulent first three weeks of his presidency.
A defiant Trump quickly pledged to battle on, tweeting within minutes of the decision: "SEE YOU IN COURT, THE SECURITY OF OUR NATION IS AT STAKE!"
"It's a political decision," he told reporters later.
The Justice Department had asked the Ninth Circuit Court of Appeals to restore the measure on an emergency basis, but the three-judge panel instead maintained the suspension ordered by a federal judge in Seattle.
"We hold that the government has not shown a likelihood of success on the merits of its appeal, nor has it shown that failure to enter a stay would cause irreparable injury," the judges ruled.
Trump's decree summarily denied entry to all refugees for 120 days, and travelers from Iran, Iraq, Libya, Somalia, Sudan, Syria and Yemen for 90 days. Refugees from Syria were blocked indefinitely.
The new Republican administration argued the ban was needed to prevent Islamic State and Al-Qaeda fighters from reaching US soil, but it prompted travel chaos and was roundly rejected by immigration advocacy groups.
Critics say the measure targeted Muslims in violation of US law.
Now, the case could end up in the Supreme Court.
The San Francisco court said aspects of the public interest favored both sides, highlighting the "massive attention" the case had drawn.
"On the one hand, the public has a powerful interest in national security and in the ability of an elected president to enact policies," the ruling said.
"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."
While acknowledging that the Seattle judge's ruling "may have been overbroad in some respects," the panel said it was not their "role to try, in effect, to rewrite the executive order."
"The government has pointed to no evidence that any alien from any of the countries named in the order has perpetrated a terrorist attack in the United States," the court said.
Civil rights campaigners and state officials applauded the decision, vowing to fight on until the executive order is permanently scrapped. For now, it means travelers with valid visas can continue to enter the country.
Washington Governor Jay Inslee, whose administration sued for the measure to be blocked, hailed a victory for his state and the country, arguing that the ruling showed "no one is above the law, not even the president."
Human Rights Watch senior researcher Grace Meng called the decision "an important declaration of judicial independence, which is crucial for checking harmful overreach by the president."
Trump had blasted the original suspension in a series of fiery tweets and public statements.
Republican lawmakers jumped to Trump's defense, with Senator Tom Cotton calling the ruling "misguided," while Democrats hailed it.
"Pres Trump ought to see the writing on the wall, abandon proposal, roll up his sleeves & come up w/ a real, bipartisan plan to keep us safe," Senate Democratic minority leader Chuck Schumer tweeted.
Democratic Senator Patrick Leahy, a former chairman of the Judiciary Committee, called on Trump to withdraw the executive order.
"If the president were serious about bringing our country together and keeping us safe, he would rescind this arbitrary and discriminatory order and recall what makes our country great," he said.
Trump's election rival Hillary Clinton tweeted simply: "3-0."
'New Era of Justice'
Ahead of the ruling, and with tensions high between the executive and the judiciary, Trump defended his hardline policies, declaring a "new era of justice" in America as he swore in Attorney General Jeff Sessions.
"We face the menace of rising crime and the threat of deadly terror," he said, doubling down on his dystopian vision of America.
"A new era of justice begins and it begins right now."
Trump's tough talk belies a political and legislative agenda that has been beset by missteps and legal challenges.
Even his own Supreme Court nominee, Neil Gorsuch, described the president's comments about the judiciary as "disheartening" and "demoralizing."
Despite experts' criticism of Trump's message, it appears to be resonating among his supporters.
The billionaire won the election last November with 46 percent of the popular vote, and the RealClearPolitics average of polls shows his job approval at about the same level, with the split largely along Republican-Democratic lines.
His administration has 14 days to file a petition for reconsideration of Thursday's ruling, either by the same panel or "en banc" — meaning by every judge on the court.
Another option would be to ask the Supreme Court to review the case, although some analysts have argued that that path poses the possibility of an embarrassing defeat, given the unanimity of the San Francisco panel, which included a Republican-appointed judge.