President Donald Trump appears likely to win his travel ban case at the Supreme Court.

Chief Justice John Roberts and Justice Anthony Kennedy both signaled support for the travel policy in arguments Wednesday at the high court. The ban's challengers almost certainly need one of those two justices if the court is to strike down the ban on travelers from several mostly Muslim countries.

The travel ban case is the court's first comprehensive look at a Trump policy - one of considerable importance to the president and highly controversial since it was first rolled out a week after Trump took office.

Justice Sonia Sotomayor was the most aggressive questioner of Solicitor General Noel Francisco in his defense of the Trump policy, and the three other liberal justices also raised questions about it.

Packed house: People waited in line outside the Supreme Court in Washington for days to be in the gallery when the court hears arguments in on April 25 - this picture was taken on Monday

Big day: Chief Justice of the Supreme Court John Roberts was at the White House for the state dinner Trump hosted for French President Emmanuel Macron

The justices voted in December to allow the policy to take full effect pending their full consideration. Wednesday was the first time they took it up in open court.

The Trump administration is asking the court to reverse lower court rulings that would strike down the ban.

The Supreme Court is considering whether the president can indefinitely keep people out of the country based on nationality. It is also looking at whether the policy is aimed at excluding Muslims from the United States. A decision is expected by late June.

Kennedy challenged lawyer Neal Katyal, representing the policy's opponents, 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 Francisco whether Trump's campaign trail call to keep Muslims from entering the United States should be considered in evaluating the administration's ban. Francisco told the justices that they shouldn't look at Trump's campaign statements.

Kennedy pressed on that point. Speaking of a hypothetical 'local candidate,' he asked if what was said during the candidate's campaign was irrelevant if on 'day two' of his administration the candidate acted on those statements.

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

From the other side, Sotomayor told Francisco she doubted that the president has 'the authority to do more than Congress has already decided is adequate' under immigration law. She and Justice Elena Kagan also questioned Francisco closely about whether the ban discriminates against Muslims.

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 just one country - Iran - among the 10 largest with Muslim majorities. 'Would a reasonable observer think this is a Muslim ban?' Alito asked.

People waited in line for seats for days, and on Wednesday morning opponents of the ban demonstrated outside the court holding signs that read 'No Muslim Ban. Ever' and 'Refugees Welcome,' among other things.

In another sign of heightened public interest, the court took the rare step of making an audio recording of the proceedings available. 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 first rolled out a week after taking office, triggering chaos and protests across the U.S. as travelers were stopped from boarding international flights and detained at airports for hours.

The first version was blocked by courts and withdrawn. Its replacement was allowed to take partial effect, but expired in September.

Protests: The hearing is a flashpoint for demonstrations against the ban

Decision time: The Supreme Court Justice are front row, from left to right: Associate Justice Ruth Bader Ginsburg, Associate Justice Anthony Kennedy, Chief Justice John Roberts, Associate Justice Clarence Thomas, Associate Justice Stephen Breyer; back row left to right: Associate Justice Elena Kagan, Associate Justice Samuel Alito Jr., Associate Justice Sonia Sotomayor, and Associate Justice Neil Gorsuch

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.

Trump's campaign pledge to shut down Muslims' entry into the U.S., his presidential tweets about the travel ban and last fall's retweets of inflammatory videos that stoked anti-Islam sentiment all preceded the justices' questioning of Francisco, defending the ban, and Katyal, the former acting solicitor general under President Barack Obama.

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, backed by a diverse array of supporting legal briefs, 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.