Adam Chilton is an assistant professor of law at the University of Chicago Law School where he teaches immigration law. Genevieve Lakier is an assistant professor of law at the University of Chicago Law School where she teaches constitutional law.

When the Supreme Court considers President Trump’s travel ban in October, the justices will have plenty of ways to avoid ruling on whether it exceeded his constitutional authority. They could, for example, dismiss the case as moot because the administration’s 90-day moratorium on issuing visas to people from the banned countries will have run its course.

But if the justices decide to rule on the constitutional questions posed by the case, they will have the opportunity to weigh in on the long-standing legal principle known as the “plenary power doctrine,” which gives the president and Congress extraordinary power to take action when it comes to immigration law. The court should seize this opportunity to once and for all rid our legal system of this outdated doctrine.

The plenary power doctrine dates to 1889, when the Supreme Court unanimously upheld a law that barred Chinese laborers from returning to the United States after leaving the country. The case, Chae Chan Ping v. United States, has come to stand for the proposition that the political branches enjoy extremely broad discretion over whom to admit to the United States and that courts should not scrutinize their choices too closely.

For more than a century, courts have relied on the plenary power doctrine to uphold the constitutionality of distinctions in immigration cases that would not be permitted in other areas of law. For example, the Supreme Court used the doctrine to uphold the constitutionality of laws banning communists from entering the United States unless they were provided a waiver by the attorney general. It also used the doctrine to uphold the constitutionality of laws that made it more difficult for men than women to pass on U.S. citizenship to their children.

The Supreme Court has never overturned these precedents. Nevertheless, the lower courts that addressed the challenges to Trump’s travel ban seemingly did not want to ignore evidence that the travel ban was motivated by religious animus, so they found creative ways to argue that the ban does not deserve the extraordinary deference provided by the plenary power doctrine.

It’s easy to understand why: Lower courts do not have the authority to overturn Supreme Court opinions. But the Supreme Court can overturn its own precedents, and it should take this opportunity to squarely reject the plenary power doctrine as both outdated and unnecessary.

The doctrine is outdated because of its racist origins. The Chinese exclusion laws that the Supreme Court upheld in Chae Chan Ping were motivated by virulent stereotypes of Chinese people as inferior and dangerous. These kinds of racist and xenophobic sentiments are no longer considered a valid basis for formulating government policy. Why should they be permissible here?

The doctrine is also unnecessary. Applying ordinary constitutional principles to immigration laws would not deprive the government of any necessary policymaking authority. The government would still be able to distinguish among aliens to promote diplomatic, national security and other legitimate goals. It simply could not do so based on animus against their religion, gender or race.

In the case of the travel ban, if the plenary power doctrine did not apply, the government would only have to show that the ban was motivated by a rational rather than discriminatory purpose. This is a relatively easy burden for the government to satisfy in most cases — although it might prove challenging in this one. If the plenary power doctrine does apply, however, the travel ban would be upheld even if the government confessed that it was deliberately designed to target Muslims.

Likely because of the plenary power’s odious history and obsoleteness, the Supreme Court has narrowed the scope of the doctrine considerably over the past few decades. Last month, it issued an opinion that concluded that the plenary power doctrine should not apply to laws on the conferral of citizenship. In other cases, it has simply ignored the plenary power precedents.

There are reasons, however, that both liberal and conservative justices should support finally getting rid of the doctrine. Liberal justices should support doing so because the doctrine, even in its narrowed form, provides cover for what would otherwise be unconstitutional discrimination. Conservative justices should support getting rid of the doctrine because there is no textual basis in the Constitution for excusing immigration law and policy from constitutional constraints.

If the Supreme Court continues to narrow or ignores the plenary power doctrine instead of explicitly rejecting it, it will leave the door open for the government and courts to rely on it in future cases. If the justices instead use the case of Trump’s travel ban to eliminate this obsolete doctrine, they could at least get something positive out of this disgraceful episode.