National security does not trump the US constitution.

That’s what the Fourth Circuit Court of Appeals in Virginia told Donald Trump on May 25, in the latest ruling on the president’s controversial executive order barring travelers from certain Muslim-majority countries from entering the US. The Fourth Circuit upheld an injunction issued by a lower court, saying the likely constitutional violations Trump’s executive order presents outweigh the government’s claimed interest in national security.

This is the second time the federal courts of appeal have upheld temporary halts of Trump’s attempts to impose a travel ban. The original version of the presidential policy was similarly blocked earlier this year on grounds that it appeared religiously motivated and likely violated the Constitution’s Free Establishment Clause, which protects free religious exercise. The Trump administration rewrote the order to address the court’s concerns, dropping language referring to Muslims and excluding longer permanent residents and visa holders from the ban. Then, a Maryland federal district court issued an injunction blocking this version of the travel ban, which has now been affirmed by the Fourth Circuit.

The next stop for this case will likely be the Supreme Court, where attorney general Jeff Sessions has vowed to appeal the decision.“This Department of Justice will continue to vigorously defend the power and duty of the executive branch to protect the people of this country from danger,” he said in a statement.

But so far, the courts have indicated that the most grave danger would be not to question the executive power just because it argues its actions are in the interest of national security.

The case is providing Americans a front-seat view of the messy mechanics of the separation of powers. The executive branch of the US government has argued that the judicial branch can’t review matters when national security is at stake. But the courts have repeatedly and resoundingly disagreed. On Thursday, the 13-judge panel on the Fourth Circuit voted 10 to 3 in support of blocking the ban, and said not only do courts have the power to review the president’s decisions, but that this power is essential to protect the country’s values. For the majority, that is itself a matter of national security.

“Implicit in the term national defense is the notion of defending those values and ideals which set this nation apart,” the court wrote in its decision. “It would be ironic if, in the name of national defense, we would sanction the subversion of one of those liberties which makes the defense of the nation worthwhile.”

The court admitted there may be some valid national security interests in some aspect of the travel ban. But ultimately, it found Trump’s arguments that the ban is necessary to protect Americans to be “a post hoc, secondary justification for an executive action rooted in religious animus and intended to bar Muslims from this country.”

It’s a big setback for Trump, who often invokes US national security to rally support for his policies, whether on immigration or trade. As the court told him, that argument “is no silver bullet.”

Whatever the Supreme Court may decide should it review an appeal, the lower court decisions show the judiciary takes separation of powers very seriously. There’s precedent to justify their decision, as the Fourth Circuit’s majority opinion explains, ”Although the Supreme Court has certainly encouraged deference in our review of immigration matters that implicate national security interests, it has not countenanced judicial abdication, especially where constitutional rights, values, and principles are at stake.”