[Update: This article has been updated to include details from Wednesday's hearing.]

Disruption has been a hallmark of Donald Trump’s presidency to date, and never was that more apparent than in the hours after he signed his first travel ban executive order.

Drafted and signed with little input from federal officials or White House lawyers, the late-January executive order left travelers stranded around the world, families separated, and federal agencies confused. It also provoked protests, months of legal battles, two new versions of the order, and presidential tweets disparaging the judiciary that had some observers fearing a constitutional crisis.

But the saga could now be nearing its end. The US Supreme Court heard oral arguments today in a lawsuit out of Hawaii against the most recent version of the ban. Travel ban 3.0, as it has become known, restricts the entry of almost 150 million nationals from Libya, Iran, Somalia, Syria, Yemen, and North Korea, as well as some Venezuelan officials. (President Trump removed Chad from the list of banned countries earlier this month.) Five of those countries have Muslim populations of at least 90 percent, leading critics to claim the ban is Trump’s effort to fulfill his campaign promise of a “total and complete shutdown” of Muslims entering the US.

Pleading its case in district courts from Washington to Maryland to New York, and in appeals courts in California and Virginia, the Trump administration has found the most success with the high court during the 15 months of litigation. The justices allowed the third executive order to go into partial effect last fall while it was being argued in lower courts. Both the Fourth and Ninth Circuit Courts of Appeal then ruled against the administration, setting up what could be the controversial policy’s final day in court this morning.

The justices considered several significant questions that have remained unanswered since those chaotic first days in January 2017: Does it violate federal law? Is it unconstitutional? Should courts defer to presidents on immigration and national security matters? Should courts defer to an unorthodox executive on these matters? Should they examine statements he makes outside of court, or made during his campaign?

Both sides have warned of dire consequences should the other side win. Seventy-six amicus briefs have been filed in the case, with one saying the justices are now facing a modern-day Korematsu v. US, a dark chapter in the high court’s history in which it deemed constitutional the internment of Japanese-Americans during World War II.

However they rule in the case, the high court has already acknowledged its significance by posting the audio of the argument online this afternoon, as opposed to the usual first Friday after the argument. It is the first time the court has provided same-day audio since the Obergefell v. Hodges ruling legalizing same-sex marriage in 2015.

“It’s a message that this is a case of great import to impacted families and to the public,” says Shoba Sivaprasad Wadhia, an immigration law professor at Penn State Law in University Park, Penn.

Questions at the heart of the debate

The principal legal debates over the travel ban have focused on two questions: whether the Trump administration has exceeded its lawful authority; and whether, by excluding nationals from five Muslim-majority countries, the executive order violates the Establishment Clause of the Constitution.

When it comes to immigration and national security concerns, the judiciary usually gives the White House broad deference. Courts are not supposed to craft policy, and the executive branch is presumed to have more expertise on these issues. The Trump administration is arguing precisely these points – noting that the third version of the ban, unlike the others, was based on a months-long global review of security screening and information sharing by various countries. It has warned the Supreme Court about the dangers of upsetting that tradition.

Lower courts “nullified a formal national security directive of the President of the United States acting at the height of his power. That conclusion cannot be squared with established rules of judicial review, statutory and constitutional interpretation, and equitable relief.”

“Especially in cases like this one that spark such passionate public debate,” the administration said in its brief, “it is all the more critical that courts faithfully adhere to those fundamental rules, which transcend this debate, this Order, and this constitutional moment.”

Chief Justice John Roberts drew attention to this point, telling Neal Katyal, the lawyer for Hawaii, that the president “may have more particular problems in light of particular situations developing on the ground.”

“It seems to me a difficult argument to say that Congress was prescient enough to address any particular factual situation that might arise,” he added.

Specifically, the administration argues that the travel ban is legal due to a section of the Immigration and Nationality Act (INA) that says the president is allowed to deny entry of any class of aliens to the US if it “would be detrimental to the interests” of the country. The administration also points to the president’s constitutional powers as commander-in-chief.

How the court comes down on that question is important, says Josh Blackman, a professor at the South Texas College of Law in Houston, “because if the court rules that Trump lacks the power to exclude, that limits the power of not just this president but future presidents.”

“There’s no doubt he’s using his powers more broadly than past presidents, but that doesn’t resolve the case,” he adds. “The [INA] is very open-ended, and I don’t think it permits the limitations that Hawaii wants to read into it.”

For its part, Hawaii points to another section of the INA that forbids discrimination on the basis of race, nationality, or place of birth when issuing an immigration visa.

And from national security threats, to crimes of “moral turpitude,” to health-related grounds, “Congress has actually done a lot when it comes to outlining who is admissible to the United States and the reasons why someone could be excluded,” says Professor Wadhi, who co-authored an amicus brief supporting Hawaii.

On Wednesday, Justice Sonia Sotomayor voiced some skepticism.

“What I see the president doing here is saying, ‘I am going to add more to the limits that Congress set,’ ” she said. “Where does a president get the authority to do more than Congress has already decided is adequate?”

US Solicitor General Noel Francisco told the justices that the INA gives the president the authority “supplement” the vetting systems Congress has established. With the travel ban, a supplement the administration wants is the “diplomatic pressure” it puts on nations that are found to fall short in terms of security screening and information sharing, he said.

But Justice Elena Kagan questioned whether that would be enough to shield an order from judicial review, first by describing a hypothetical president who “says all kinds of denigrating comments about Jews” then issues an order denying Israeli nationals entry to the US.

“This is an out-of-the-box president in my hypothetical ... and he thinks that there might be good diplomatic reasons to put pressure on Israel,” she said. “Do you say [that] puts an end to judicial review of that set of facts?”

The 'four corners' question

The executive order itself makes no mention of Muslims or Islam, so the statements Trump has made outside the courtroom lie at the heart of the Establishment Clause claim. Nevertheless, the Fourth Circuit ruled earlier this year that the order is “not only a likely Establishment Clause violation, but also strikes at the basic notion that the government may not act based on religious animosity” because Trump “has openly and often expressed his desire to ban those of Islamic faith from entering the United States.”

But while the Fourth Circuit was willing to look outside the so-called four corners of the order to Trump’s outside statements – which include tweets criticizing a federal judge who ruled against him and his own Justice Department for defending a “watered down” version of the first executive order – that is an unusual approach the Supreme Court may not choose to take.

Mr. Francisco said that Trump’s campaign statements “are made by a private citizen,” and that it is not until a president takes the oath of office and can receive the advice of his cabinet that they become “an embodiment of the executive branch.

In one of his few questions, Justice Anthony Kennedy – who could be a deciding vote in the case – asked whether that would be the case for a local mayor who makes “hateful statements” during a campaign.

If “on Day 2, he takes acts that are consistent with those hateful statements,” Justice Kennedy added, “whatever he said in the campaign is irrelevant?”

Francisco acknowledged at one point that if the president made such a statement “that would undermine the facially legitimacy of the action.”

“But that’s not the case here,” he said, adding that in statements on Sept. 25 the president had “made it crystal clear that Muslims in this country are great Americans and there are many, many Muslim countries who love this country.”

Question of judicial deference

This question of judicial deference to the executive has been a consistent theme of the travel ban litigation, and of the Trump presidency as a whole.

Some observers, pointing to what they consider erratic presidential behavior, have wondered if courts should give Trump the same “presumption of regularity” – a doctrine that courts read executive orders in a way that is not hostile to the president – they have given past presidents.

Courts so far have not been shy about ruling against the administration. Just yesterday, a federal judge in Washington ruled that the White House rescission of the Deferred Action for Childhood Arrivals (DACA) program was “arbitrary and capricious” and offered “meager legal reasoning” for declaring it unlawful. Judge John Bates, who was nominated by President George W. Bush, ordered that the program be reopened and new applicants accepted, but gave the administration a 90-day delay so that the White House would have an opportunity to outline its reasoning.

But the Supreme Court, with the weight of precedent in every decision, tends to be much more cautious.

To date, the justices have given few hints as to what they think of the travel ban. The justices have twice allowed the executive order to go into effect – first for the second version, then for the third version – and in its most recent decision only Justices Ruth Bader Ginsburg and Sotomayor dissented. And while Justice Kennedy showed interest in the constitutional claims in the case – and pointed out that similar proclamations issued by Presidents Jimmy Carter and Ronald Reagan were “one or two sentences” – he seemed skeptical of Hawaii’s arguments.

“Your argument is,” he said to Mr. Katyal, “that courts have the duty to review whether or not there is such a national contingency – that’s for the courts to do, not the President?”