Every president is sworn to “preserve, protect and defend the Constitution of the United States,” so before considering whether Donald Trump’s plan to ban all Muslim immigration into the country is good policy, Americans needs to ask if it’s constitutional.

The answer is: “Maybe.” But there are alternatives.

Trump responded to recent Islamic terrorist activity by saying that he would ban all Muslims from entering the United States. It appears that he is referring only to Muslims who are not U.S. citizens and not already here; he’s talking about foreign Muslims seeking to enter America. And he also refers to this as a temporary ban until leaders can remedy the problem of jihadists entering this country, not a permanent policy.

Trump’s statements have not only sparked a firestorm in political and policy circles, but also set off a serious debate among constitutional lawyers.

As a general matter, Congress has complete control—called “plenary power”—over immigration, which is the power to let people into this country, decide how long they can stay, and under what circumstances.

But that power is found in Article I of the Constitution. The Constitution has been amended 27 times, so the question is whether any of those subsequent amendments have imposed any limits on Congress’s immigration power.

The law gives employers complete discretion on who to hire—they can fire or refuse to hire a person for almost any reason—but cannot do it for certain forbidden reasons, such as a person’s race. The question here is whether any constitutional amendment forbids Congress from imposing certain restrictions.

Due Process

The Fifth Amendment’s Due Process Clause says that the federal government shall not deprive any person of “life, liberty, or property, without due process of law.” The Supreme Court has held that due process is never violated by immigration restrictions, because Congress’s debating what law to adopt for foreigners crossing our border is all the due process that any foreigner is entitled to. A due-process challenge would fail.

Prof. Eugene Volokh of UCLA—one of the top First Amendment scholars in America—says about this proposed ban that there are no limits on Congress’s power over immigration, per the Supreme Court’s earlier cases (even though he also called Trump’s proposed policy an “abomination”). Prof. Eric Posner of the University of Chicago is less confident in predicting an outcome, but says the ban would probably be upheld by the courts.

Other scholars disagree.

Prof. Ira Lupu of George Washington University, and Prof. Rick Duncan at the University of Nebraska, both write that Trump’s ban would violate the First Amendment’s Establishment Clause. That provision forbids Congress from establishing an official religion, and Lupu argues the policy would require the government to determine who is really Muslim in order to know who to exclude from our borders, and that the Establishment Clause blocks the government from making such decisions.

Prof. Laurence Tribe of Harvard Law School, an arch-liberal who is also an acclaimed constitutional scholar, argues that the ban would violate both the First Amendment and the Fifth Amendment.

Prof. Michael Dorf of Cornell University adds that, “immigration policy based on religious prejudice would be equally odious, and thus unconstitutional.”

Equal Protection

One line of attack that appears to have gone unnoticed so far is whether Trump’s ban would violate equal protection. The Fourteenth Amendment’s Equal Protection Clause forbids states from denying any person equal protection under the law. In the 1954 case Bolling v. Sharpe, the Supreme Court held that this equal-protection guarantee is implicit in the Fifth Amendment’s Due Process Clause. The Fifth Amendment limits the federal government, while the Fourteenth Amendment limits the states.

Even though the Supreme Court has held that due process is not violated by immigration restrictions, the justices have not squarely faced a challenge since equal protection became one of the rights that all persons (not just citizens) have in the Fifth Amendment against the U.S. government.

Moreover, in earlier years the Court upheld grossly unconstitutional racial discrimination such as “separate but equal” in Plessy v. Ferguson (1896), and sending American citizens of Japanese descent to World War II internment camps in Korematsu v. U.S. (1944). In the 1950s, the Court fundamentally changed course in Brown v. Board of Education (1954) when the court struck down school policies that discriminated on the basis of race.

Strict Scrutiny

In the new legal regime, courts must apply “strict scrutiny” to all government actions that discriminate on the basis of a “suspect class” (like race) or on a fundamental right. A person’s exercising their religion is a fundamental right.

When strict scrutiny applies, courts presume that law or government action is unconstitutional. The burden is on the government to provide a “strong basis in evidence” proving both that the law achieves a “compelling” national interest, and that the law is “narrowly tailored” to accomplish that goal.

Guarding against terrorism is clearly a compelling interest, so that part is satisfied. But narrow tailoring requires that the law be the “least restrictive means” to accomplish the goal, not going any broader than necessary. It does not need to be precise like a key in a keyhole, but it does need to be close, with a laser-beam focus.

Trump’s ban would prevent a 50-year-old Muslim brain surgeon from Canada from going to New York City for two days to perform an experimental brain surgery. It would also prevent an 83-year-old Muslim grandmother in Britain from visiting her grandchildren in Michigan for two weeks. Since neither person would be considered a threat to national security, a court could rule that the law is too broad.

Related Debates

It’s possible that the courts—and ultimately the Supreme Court—could hold that all these legal challenges fail, and that Congress still has complete discretion on immigration. But America has never had such a case, so right now it’s an open question. The justices could go either way.

The closest case the Supreme Court ever faced was a law barring people engaged in polygamy, more than a century ago. But that’s not specific to only one religion (many faiths are polygamous, not just Islam), so that’s not a religion-defined exclusion. And that case was before the rise of strict scrutiny in the law, explained above, so it is not clear how modern courts would respond.

Other Angles

There are other legal challenges that have been raised by some lawyers, but all of these fail. Some say it violates the Religious Test Clause of the Constitution, but that says only that people seeking federal office cannot be denied public office because of their religion.

Others say the policy is illegal because it violates treaties that America has signed. But federal laws and treaties are of equal power, so when they are in conflict, the most recent one supersedes the earlier one. While a president might be bound a current treaty, Congress can pass a new statute to beat it.

One final angle of attack is whether the president could do this without Congress. Federal law, at 8 U.S.C. § 1182(f), provides in part:

Whenever the President finds that the entry of any aliens or any class of aliens into the United States would be detrimental to the interests of the United States, he may by proclamation, and for such period as he shall deem necessary, suspend the entry of all aliens or any class of aliens as immigrants or nonimmigrants, or impose on the entry of aliens any restrictions he may deem to be appropriate.

Prof. Peter Spiro from Temple University believes that this gives the president complete discretion.

But there is a problem with that. Congress cannot delegate to the president authority that Congress does not have, so if a congressional ban would be unconstitutional, then so would a president doing the same. Every president is bound to follow the Constitution always, just like Congress.

Alternative Approaches

There are, however, two ways that the law (or presidential restrictions) could definitely pass constitutional muster.

One way is if Congress narrows the ban by age, gender, or nationality, such as all Muslim males ages 18 through 25, or Muslims from certain countries with serious terrorist problems like Syria. Then the restriction is not defined solely by religion.

The other is if Congress imposes an ideological test. For example, denying entry to any person who the government determines believes that America should be governed by Sharia law instead of our current constitutional system, or denying entry to any person who believes Israel should be destroyed, or who believes it is okay to kill non-Muslims, or to wage jihad against Americans.

But none of this might matter.

In 2008, the Supreme Court ignored two centuries of precedent, holding 5-to-4 in Boumediene v. Bush that foreign terrorists held by our military on foreign soil were entitled to habeas corpus rights. Even if the Constitution is on the side of allowing Congress to ban Muslims, there’s nothing to stop the current Supreme Court from going the same route as in 2008, making new constitutional law to thwart Congress and the president.

This constitutional analysis does not suggest that Trump’s policy is a good or bad policy. What it does say is that in a country under the rule of law, if America is going to reclaim its constitutional form of government, then every American needs to demand that their president, Congress, and courts never waiver in their sworn duty to hammer out policy disagreements strictly within the legal commands set forth by the Constitution—even if they sincerely believe that some other immigration policy would be better for the nation.

Ken Klukowski is legal editor for Breitbart News. Follow him on Twitter @kenklukowski.