WASHINGTON (AP) — The Supreme Court seemed poised Wednesday to uphold President Donald Trump’s ban on travel to the U.S. by visitors from several Muslim-majority countries, giving the president a major victory on a signature and controversial policy.

In the court’s first full-blown consideration of a Trump order, the conservative justices who make up the court’s majority seemed unwilling to hem in a president who has invoked national security to justify restrictions on who can or cannot step on U.S. soil.

The justices in December allowed the ban to take full effect even as the legal fight over it continued, but Wednesday was the first time they took it up in open court. Trump’s tough stance on immigration was a centerpiece of his presidential campaign, and he rolled out the first version of the ban just a week after taking office, sparking chaos and protests at a number of airports.

The ban’s challengers almost certainly need either Chief Justice John Roberts or Justice Anthony Kennedy on their side if the court is to strike down the policy that its opponents have labeled a Muslim ban.

But neither appeared receptive to arguments made by lawyer Neal Katyal, representing the ban’s opponents, that Trump’s rule stems from his campaign pledge to keep Muslims out of the country and is unlike immigration orders issued by any other president.

The room was packed for the court’s final arguments until October, and people waited in line for seats for days. “Hamilton” creator Lin-Manuel Miranda was in the audience. Demonstrators protesting the ban filled the area outside the building.

Advertisement

Some who oppose the ban have said courts should treat Trump differently from his predecessors. But that issue was raised only obliquely from the bench when Justice Elena Kagan talked about a hypothetical president who campaigned on an anti-Semitic platform and then tried to ban visitors from Israel.

When Solicitor General Noel Francisco, defending the ban, started to answer that such a turn of events was extremely unlikely because of the two countries’ close relationship, Kagan stopped him. “This is an out-of-the-box kind of president in my hypothetical,” she said, to laughter.

“We don’t have those, Your Honor,” Francisco replied.

While there was discussion about Trump’s statements both as a candidate and as president, no justice specifically referenced his tweets on the subject, despite Katyal’s attempt to get them to focus on last fall’s retweets of inflammatory videos that stoked anti-Islam sentiment.

Justice Sonia Sotomayor was the most aggressive questioner of Francisco.

She told him she doubted that the president has “the authority to do more than Congress has already decided is adequate” under immigration law. She and Kagan also questioned Francisco closely about whether the ban discriminates against Muslims.

Advertisement

From the other side, Kennedy challenged Katyal about whether the ban would be unending. He said the policy’s call for a report every six months “indicates there’ll be a reassessment” from time to time.

“You want the president to say, ‘I’m convinced that in six months we’re going to have a safe world,'” Kennedy said, seemingly rejecting Katyal’s argument.

His only question that seemed to favor the challengers came early in the arguments, when he asked Solicitor General Francisco whether Trump’s campaign statements should be considered in evaluating the administration’s ban. Francisco told the justices they shouldn’t look at those campaign statements.

Kennedy pressed on that point. Speaking of a hypothetical candidate for mayor, he asked if what was said during that candidate’s campaign was irrelevant if on “day two” of his administration the new mayor acted on those statements.

Francisco held his ground saying the presidential oath of office “marks a fundamental transformation.”

With Katyal at the lectern, Justice Samuel Alito said it seemed wrong to call the travel policy a Muslim ban when it applies to just five of 50 mostly Muslim countries, 8 percent of the world’s Muslim population and only one country — Iran — among the 10 largest with Muslim majorities. “Would a reasonable observer think this is a Muslim ban?” Alito asked.

Advertisement

Outside the court, opponents of the ban held signs that read “No Muslim Ban. Ever” and “Refugees Welcome.” In another indication of heightened public interest, the court released an audio recording after arguments ended. The last time the court did that was for gay marriage arguments in 2015.

The justices are looking at the third version of a policy that Trump brought out shortly after taking office. That brought immediate turmoil as travelers were stopped at airports and some were detained for hours. The first version was blocked by courts and withdrawn. Its replacement was allowed to take partial effect, but expired in September.

The current version is indefinite and now applies to travelers from five countries with overwhelmingly Muslim populations — Iran, Libya, Somalia, Syria and Yemen. It also affects two non-Muslim countries, blocking travelers from North Korea and some Venezuelan government officials and their families. A sixth majority-Muslim country, Chad, was removed from the list this month after improving “its identity-management and information sharing practices,” Trump said in a proclamation.

The administration has argued that courts have no role to play because the president has broad powers over immigration and national security, and foreigners have no right to enter the country. Francisco also has said in written arguments that Trump’s September proclamation laying out the current policy comports with immigration law and does not violate the Constitution because it does not single out Muslims.

The challengers have said that Trump is flouting immigration law by trying to keep more than 150 million people, the vast majority of them Muslim, from entering the country. They also argue that his policy amounts to the Muslim ban that he called for as a candidate, violating the Constitution’s prohibition against religious bias.

The case is Trump v. Hawaii, 17-965.

In this April 23, 2018, photo, people wait in line outside the Supreme Court in Washington, to be in the gallery when the court hears arguments in on April 25, over President Donald Trump’s ban on travelers from several mostly Muslim countries. (AP Photo/Jessica Gresko)