“The question is, what are reasonable observers to think in that context?” Justice Kagan asked.
Mr. Francisco acknowledged that “it’s a tough hypothetical” but insisted that in the case before the court, the administration’s basis for the travel ban was fully documented as a result of concerns about national security, and not on Mr. Trump’s personal beliefs.
“No matter what standard you apply, this proclamation is constitutional,” he insisted.
Justice Kennedy pressed Neal K. Katyal, a lawyer for the challengers, about why courts should second-guess a president’s national security judgments. Chief Justice Roberts posed hypothetical questions about the president’s power to thwart terrorist attacks, and he asked whether Mr. Trump is forever unable to address immigration in light of his campaign statements.
Listen: Justices Hear Arguments on Trump’s Travel Ban
“Is there a statute of limitations on that?” the chief justice asked.
Just a week after he took office, Mr. Trump issued his first travel ban, causing chaos at the nation’s airports and starting a cascade of lawsuits and appeals. Fifteen months later, after two revisions of the ban and a sustained losing streak in the lower courts, the Supreme Court took up the case in its last scheduled argument of the term.
Although the court had considered aspects of an earlier version of the travel ban, this was the first time the justices heard arguments on any of the challenges. A decision is expected by late June.
The case, Trump v. Hawaii, No. 17-965, concerns Mr. Trump’s third and most considered bid to make good on his campaign promise to secure the nation’s borders. Challengers to the latest ban, issued as a presidential proclamation in September, said Mr. Trump’s campaign speeches and tweets about Muslims were a clear indication that the ban was aimed at a particular religious group and not justified by security concerns.
The administration said the third order was the product of careful study by several agencies into the security and information-sharing practices of nations around the world. Mr. Trump’s lawyers urged the courts to ignore Mr. Trump’s statements and Twitter posts, and to focus solely on the text of the proclamation and the process that produced it.
Mr. Francisco noted that the agencies excluded “the majority of the world, including the vast majority of the Muslim world” from the travel ban.
But several justices pressed Mr. Francisco to explain the legal basis for the president’s decision-making on the travel ban.
“Where does the president get the authority to do more than Congress has already decided is adequate,” Justice Sonia Sotomayor asked him. Mr. Francisco cited longstanding immigration laws, which he said give the executive branch broad authority to determine who enters the country.
The administration is facing other challenges to its immigration policies. Several federal judges, including one on Tuesday, have blocked the administration’s efforts to end a separate program that shields some undocumented young adults from deportation. Those cases on the program, called Deferred Action for Childhood Arrivals, or DACA, are likely to reach the Supreme Court over time.
Mr. Trump’s first travel ban, issued in January 2017, was promptly blocked by courts around the nation. A second version, issued two months later, fared little better, though the Supreme Court allowed part of it go into effect in June when it agreed to hear the Trump administration’s appeals from two appeals court losses. But the Supreme Court dismissed those appeals in October after the second ban expired.
The current ban initially restricted travel from eight nations — Iran, Libya, Syria, Yemen, Somalia, Chad, Venezuela and North Korea — six of which were predominantly Muslim. Chad was recently removed from the list.
The restrictions vary in their details, but, for the most part, citizens of the countries are prohibited from immigrating to the United States, and many are barred from working, studying or vacationing here.
In December, in a sign that the Supreme Court may uphold the latest order, the court allowed it to go into effect as the case moved forward. The decision effectively overturned a compromise in place since last June, when the court said travelers with connections to the United States could continue to travel here notwithstanding restrictions in an earlier version of the ban.
Justices Ruth Bader Ginsburg and Sonia Sotomayor dissented from the December ruling.
Hawaii, several individuals and a Muslim group challenged the latest ban’s limits on travel from the predominantly Muslim nations; they did not object to the portions concerning North Korea and Venezuela. They prevailed before a Federal District Court there and before a three-judge panel of the United States Court of Appeals for the Ninth Circuit, in San Francisco.
The appeals court ruled that Mr. Trump had exceeded the authority that Congress had given him over immigration and had violated a part of the immigration laws barring discrimination in the issuance of visas.
In a separate decision that is not directly before the justices, the United States Court of Appeals for the Fourth Circuit, in Richmond, Va., blocked the ban on different grounds, saying it violated the Constitution’s prohibition of religious discrimination.
The Supreme Court said it would consider both the statutory and constitutional questions when it agreed to hear the case.
Lawyers for the challengers have said Mr. Trump’s own statements provided powerful evidence of anti-Muslim animus. The latest order, they said, was infected by the same flaws as the previous ones.