In a major setback for the Trump administration, a federal appeals court on Thursday declined its urgent request to restore the controversial executive order restricting refugees and travel by immigrants from a number of Muslim-majority countries.

Rejecting arguments that the government would be “irreparably harmed” if the judicial system reviewed President Donald Trump’s immigration ban, which he premised on his authority over national security matters, the U.S. Court of Appeals for the 9th Circuit determined unanimously that the judiciary has a proper role in safeguarding people’s rights.

“To the contrary, while counseling deference to the national security determinations of the political branches,” the court said, “the Supreme Court has made clear that the Government’s authority and expertise in [such] matters do not automatically trump the Court’s own obligation to secure the protection that the Constitution grants to individuals, even in times of war.”

Citing an important Bush-era Supreme Court precedent on national security, the 9th Circuit took issue with the Trump administration’s argument that it had no business or power to review the legality of the president’s executive order ― or that it would violate the separation of powers for the court to do so.

“There is no precedent to support this claimed unreviewability, which runs contrary to the fundamental structure of our constitutional democracy,” the court said in the ruling. The court also said that the Trump administration pointed to "no evidence" showing a need for the executive order.

The three judges who participated in the appeal ― U.S. Circuit Judges Richard Clifton, William Canby and Michelle Friedland ― did not sign their names to the opinion, but instead issued a per curiam order, possibly to avoid being singled out by Trump, who has taken to lashing out against judges ruling against his travel ban.

The president’s response to the ruling on Twitter was in all caps.

SEE YOU IN COURT, THE SECURITY OF OUR NATION IS AT STAKE! — Donald J. Trump (@realDonaldTrump) February 9, 2017

”We have seen him in court twice, and we’re two for two,” Bob Ferguson, attorney general for the state of Washington, which alongside Minnesota challenged Trump’s order, said at a news conference Thursday night. He encouraged Trump to “tear up this executive order and start over.”

The Justice Department, which normally doesn’t comment on ongoing litigation, said it was “considering its options.”

The 9th Circuit decision effectively keeps Trump’s order from being enforced, which means one of his signature policy initiatives will remain in limbo as the litigation proceeds before the federal judge in Seattle who temporarily blocked the order’s implementation. The appeals court heard arguments in a high-stakes hearing on Tuesday.

The court declined the Trump administration’s request to limit the geographic scope of the initial court ruling against the ban, which put the brakes on the executive order everywhere in the United States. And notably, the court observed that the rights of non-citizens here, or those who have non-citizen family members abroad, would be affected if the ban was reinstated.

“The political branches are far better equipped to make appropriate distinctions,” the appeals court said, suggesting that Trump or Congress could rewrite the order to avoid constitutional pitfalls.

Critically, the ruling was not on the merits of the order, but only on the technical question of whether the judge who put a national hold on the travel ban, U.S. District Judge James Robart, followed the proper procedure for temporary restraining orders ― a kind of relief that is typically not appealable. The 9th Circuit determined that the “unusual circumstances” of this case and the government’s vigorous defense of the travel ban meant the appeals judges could step in.

That still didn’t keep the 9th Circuit from noting that the two states’ fast-moving lawsuit presents “serious allegations” and “significant constitutional questions” about religious discrimination against Muslims.

Though the judges declined to express a view on those issues, they noted that numerous statements by Trump promising a “Muslim ban,” and similar remarks that go beyond the letter of the executive order, could be used for weighing the order’s constitutionality at a later stage.

In an early-morning tweet prior to a law enforcement conference Wednesday, Trump appeared to prejudge the 9th Circuit’s outcome and call into question the motivations of the judges who considered his travel ban.

“I don’t ever want to call a court biased, so I won’t call it biased,” Trump said during a gathering of chiefs of police. “And we haven’t had a decision yet. But courts seem to be so political, and it would be so great for a justice system if they would be able to ... do what’s right. And that has to do with the security of our country, which is so important.”

Robart, the Seattle-based federal judge who on Feb. 3 put a temporary nationwide restraining order on Trump’s travel ban, said in his earlier ruling that there’s a high likelihood the executive order would cause irreparable harm to Washington and Minnesota if he didn’t block it.

Amid an avalanche of similar lawsuits across the country, the two states sued in federal court last week, claiming that the travel restrictions violate, among other things, their residents’ constitutional rights to religious freedom and equal protection of the laws. Once Robart put the ban on hold, signaling that the states may have a strong case on the merits, the administration quickly appealed.

Scores of states, tech companies and organizations weighed in on the controversy ahead of Tuesday’s YouTube-streamed 9th Circuit hearing, during which the two sides argued why the travel ban should or shouldn’t remain in force, and whether, under the Constitution, Trump has near-unreviewable authority that the courts aren’t allowed to second-guess.

Ahead of Thursday’s ruling, Robart issued a scheduling order instructing the states and the Trump administration how the case would move forward. Washington and Minnesota must submit a legal brief on Thursday, the Trump administration’s response brief is due next Wednesday, and then the states must reply by next Friday. Robart has yet to schedule a new hearing.

When he does, he’ll determine whether his original restraining order should become a preliminary injunction, which, if granted, would leave Trump’s travel ban on hold for even longer ― a result that would almost certainly be appealed all the way to the Supreme Court.

But at this early stage, an emergency appeal by the Trump administration to the Supreme Court would face a big hurdle. Five justices would need to agree to reverse the 9th Circuit, and since the death of Justice Antonin Scalia last year, the court remains one member short.

In the interim, lawyers for Washington and Minnesota are already bracing for the next stage. In a letter to the 9th Circuit filed with the court on Thursday, the states said they’re ready to submit more evidence in the lower court to support their case ― and their contention that Trump’s executive order causes harm to their sovereign interests.