Two federal judges, both nominated by President Barack Obama, have issued injunctions against President Donald Trump’s revised executive order temporarily restricting travel from six terrorist safe havens in the Middle East and Africa.

The decisions by Derrick Kahala Watson in Hawaii and Theodore David Chuang in Maryland should shock no one—not because the judges are correct, but because their decisions follow the same pattern as prior decisions in Washington state and the 9th U.S. Circuit Court of Appeals over the first order.

These rulings ignore or misinterpret federal immigration law that gives the president the clear authority to act and prior Supreme Court precedents that support the legality of the president’s actions.

Watson issued a nationwide injunction against enforcement of Section 2 and Section 6 of Executive Order 13,780, “Protecting the Nation From Foreign Terrorist Entry Into the United States.”

These are the provisions that would have suspended entry of foreign aliens for 90 days from Iran, Libya, Somalia, Sudan, Syria, and Yemen, as well as the entry of refugees for 120 days until the Department of Homeland Security has had a chance to revamp its vetting procedures.

Chuang—who worked in the Civil Rights Division of the Justice Department at one point—issued an injunction only against part of Section 2, saying that the plaintiffs had not provided sufficient evidence to warrant an injunction against the refugee provision in Section 6.

Both judges based their decisions on a supposed violation of the Establishment Clause that bars religious discrimination, even though both judges acknowledge that the actual language of the executive order does not discriminate.

Watson admits that it “is undisputed that the Executive Order does not facially discriminate for or against any particular religion, or for or against religion versus non-religion.” Nevertheless, Chuang claims (as does Watson) that “the history of public statements continues to provide a convincing case that the purpose of the Second Executive Order remains the realization of the long-envisioned Muslim ban.”

These conclusions make no sense. As the government pointed out in these cases, the revised order explicitly explains its national security purposes and provides detailed information on why these six countries were chosen.

According to Chuang, the government asserted that “there is a heightened chance that individuals from the designated countries will be ‘terrorist operatives or sympathizers’ because each country is ‘a state sponsor of terrorism, has been significantly compromised by terrorist organizations, or contains active conflict zones,’ and those governments are therefore less likely to provide necessary information for the immigrant vetting process.”

All of which is just plain common sense—except to these two liberal judges.

>>>Hawaii Has No Case Against Revised Travel Executive Order

In a fitting piece of irony that would be funny if this were not so serious, Chuang says that “courts should afford deference to national security and foreign policy judgments of the executive branch” and that “this Court thus should not, and will not, second-guess the conclusion that national security interests would be served by the travel ban.”

But then, the judge proceeds to do exactly what he just promised he wouldn’t do: He second guesses the travel ban and issues an injunction against it because he considers—apparently in his superior national security judgment—that the travel ban “represents an unprecedented response” to the “undisputed … heightened security risks with the designated countries.”

The logical extension of this reasoning about the supposed “motive” behind the executive order, based on statements made by Trump and others during a campaign, is that the order is unlawful because Trump signed it. Yet the same exact order would not be unlawful if Obama had signed it.

This goes against a basic principle of sound jurisprudence that Chief Justice Earl Warren voiced in U.S. v. O’Brien (1968) when he wrote, “This Court will not strike down an otherwise constitutional statute on the basis of an alleged illicit legislative motive.”

Just like the 9th Circuit Court, Watson avoids the relevant federal law that gives the president authority to suspend the entry of aliens. In his 43-page opinion, there is no discussion of the legality and constitutionality of 8 U.S.C. §1182(f) or whether the president acted outside the authority delegated to him by Congress.

This provision specifically gives the president the power to suspend the entry of any aliens into the United States if he finds that their entry “would be detrimental to the interests of the United States.” That is exactly the finding that Trump made, as outlined in the executive order.

>>>Court Ruling Against Trump’s Executive Order Shows the Worst of Judicial Activism

Chuang actually does discuss §1182(f), but he then claims that applying that section against immigrants, as opposed to alien visitors, violates another provision of federal immigration law, 8 U.S.C. §1152(a)(1)(A). This provision prohibits discrimination “in the issuance of an immigrant visa because of his race, sex, nationality, place of birth, or place or residence.”

Chuang dismisses the government’s argument that another provision of that same law—which specifically says that nothing in §1152 (a) “shall be construed to limit the authority of the secretary of state to determine the procedures for the processing immigrant of visa applications”—doesn’t apply to Trump’s action.

Why? Because Trump is not the secretary of state,” and this provision “expressly applies to the secretary of state.”

This is a bizarre conclusion. The president does not process visa applications himself. That is the State Department’s job, and the secretary of state is answerable directly to the president.

A provision of federal law such as this one that gives the secretary of state the authority “to determine the procedures” for alien visas is obviously authority that the president can direct the secretary to exercise. Chuang’s legal reasoning makes no sense.

Both judges also ignored precedents like Sale v. Haitian Centers Council, in which the U.S Supreme Court upheld a ban on the entry of refugees from Haiti issued by President George H.W. Bush and continued by President Bill Clinton.

They also ignored U.S. ex rel. Knauff v. Shaughnessy, where the Supreme Court held, in a case over the exclusion of an alien wife of an American citizen, “that it is not within the province of any court, unless authorized by law, to review the determination of the political branch of the government to exclude a given alien.”

And the court also said that the only due process right an alien who is denied entry has is “the procedure authorized by Congress.” Foreign aliens have no constitutional right to enter the U.S., no matter what these federal judges erroneously believe.

There seems little doubt that the Justice Department will appeal these orders. Given how far the courts of appeal have slanted to the left during the Obama administration, it would be no surprise if these injunctions are upheld even though they should be thrown out.

That will leave it up to the Supreme Court to tamp down this judicial usurpation of the executive branch’s authority over national security, terrorism, and immigration.