Solicitor General Noel J. Francisco, representing the administration, said the latest travel ban, issued in September as a presidential proclamation, was not directed at Muslims.

“This is not a so-called Muslim ban,” he said. “If it were, it would be the most ineffective Muslim ban that one could possibly imagine.” It excluded, he said, “the vast majority of the Muslim world.”

Justice Samuel A. Alito Jr. added his own statistics.

“I think there are 50 predominantly Muslim countries in the world,” he said. “Five predominantly Muslim countries are on this list. The population of the predominantly Muslim countries on this list make up about 8 percent of the world’s Muslim population. If you looked at the 10 countries with the most Muslims, exactly one, Iran, would be on that list of the top 10.”

Neal K. Katyal, a lawyer for the challengers, rejected that analysis. “If I’m an employer and I have 10 African-Americans working for me and I only fire two of them” but retain the other eight, he said, “I don’t think anyone can say that’s not discrimination.”

Mr. Trump issued his first travel ban a week after he took office, causing chaos at the nation’s airports and starting a cascade of lawsuits and appeals. The case before the court, Trump v. Hawaii, No. 17-965, concerns Mr. Trump’s third and most concerted effort to make good on his campaign promise to secure the United States’ borders. The court had considered aspects of an earlier version of the travel ban, but this was the first time the justices heard arguments on any of the challenges.