WASHINGTON — The Supreme Court upheld President Trump’s ban on travel from several predominantly Muslim countries, delivering to the president on Tuesday a political victory and an endorsement of his power to control immigration at a time of political upheaval about the treatment of migrants at the Mexican border.
In a 5-to-4 vote, the court’s conservatives said that the president’s power to secure the country’s borders, delegated by Congress over decades of immigration lawmaking, was not undermined by Mr. Trump’s history of incendiary statements about the dangers he said Muslims pose to the United States.
Writing for the majority, Chief Justice John G. Roberts Jr. said that Mr. Trump had ample statutory authority to make national security judgments in the realm of immigration. And the chief justice rejected a constitutional challenge to Mr. Trump’s third executive order on the matter, issued in September as a proclamation.
The court’s liberals denounced the decision. In a passionate and searing dissent from the bench, Justice Sonia Sotomayor said the decision was no better than Korematsu v. United States, the 1944 decision that endorsed the detention of Japanese-Americans during World War II.
She praised the court for officially overturning Korematsu in its decision on Tuesday. But by upholding the travel ban, Justice Sotomayor said, the court “merely replaces one gravely wrong decision with another.”
The court’s travel ban decision provides new political ammunition for the president and members of his party as they prepare to face the voters in the fall. Mr. Trump has already made clear his plans to use anti-immigrant messaging as he campaigns for Republicans, much the way he successfully deployed the issue to whip up the base of the party during the 2016 presidential campaign.
Mr. Trump, who has battled court challenges to the travel ban since the first days of his administration, hailed the decision to uphold his third version as a “tremendous victory” and promised to continue using his office to defend the country against terrorism, crime and extremism.
“This ruling is also a moment of profound vindication following months of hysterical commentary from the media and Democratic politicians who refuse to do what it takes to secure our border and our country,” the president said in a statement issued by the White House soon after the decision was announced.
The decision came even as Mr. Trump is facing controversy over his decision to impose “zero tolerance” for illegal immigration at the United States’ southwestern border, leading to politically damaging images of children being separated from their parents as families cross into the country without proper documentation.
But as Mr. Trump celebrated his travel ban victory, a federal judge in California ordered the government to stop separating children from their parents at the border and to reunite families already separated.
Late Tuesday night, the judge said that all families must be reunited within 30 days and that children under 5 must be returned to the custody of their parents within two weeks.
The judge’s order came as the president faces a second legal challenge about the family separations. Seventeen states and the District of Columbia filed a lawsuit on Tuesday in federal court seeking to stop the practice.
Mr. Trump and his advisers have long argued that presidents are given vast authority to reshape the way that the United States controls its borders. The president’s attempts to do that began with the travel ban and continues today with his demand for an end to the “catch and release” of unauthorized immigrants.
In remarks on Tuesday in a meeting with lawmakers, Mr. Trump vowed to continue fighting for a wall across the southern border with Mexico — his favorite physical manifestation of the legal powers that the court says he rightly wields.
“We have to be tough and we have to be safe and we have to be secure,” he said, adding that construction of the wall “stops the drugs.”
“It stops people we don’t want to have,” the president said.
Several hundred angry protesters gathered in Washington on the court’s marble steps with signs that read, “No Ban, No Wall,” “Resist Trump’s Hate” and “Refugees Welcome!”
In New York City, about three dozen activists, government officials and concerned citizens declared at a midday news conference that the court was on the “wrong side of history.” Bitta Mostofi, the commissioner of immigrant affairs for the New York mayor’s office, called the ruling an “institutionalization of Islamophobia and racism.”
Senator Robert Menendez, Democrat of New Jersey, wrote that “today is a sad day for American institutions, and for all religious minorities who have ever sought refuge in a land promising freedom.” The Baptist Joint Committee for Religious Liberty said in a statement that “we are deeply disappointed by the Supreme Court’s refusal to repudiate policy rooted in animus against Muslims.”
Mr. Trump’s ban on travel had been in place since December, when the court denied a request from challengers to block it. Tuesday’s ruling lifts the legal cloud over the policy.
Chief Justice Roberts acknowledged that Mr. Trump had made many statements concerning his desire to impose a “Muslim ban.” He recounted the president’s call for a “total and complete shutdown of Muslims entering the United States,” and he noted that the president has said that “Islam hates us” and has asserted that the United States was “having problems with Muslims coming into the country.”
But the chief justice said the president’s comments must be balanced against the powers of the president to conduct the national security affairs of the nation.
“The issue before us is not whether to denounce the statements,” Chief Justice Roberts wrote. “It is instead the significance of those statements in reviewing a presidential directive, neutral on its face, addressing a matter within the core of executive responsibility.”
“In doing so,” he wrote, “we must consider not only the statements of a particular president, but also the authority of the presidency itself.”
The chief justice repeatedly echoed Stephen Miller, Mr. Trump’s top immigration adviser, in citing a provision of immigration law that gives presidents the power to “suspend the entry of all aliens or any class of aliens” as they see necessary.
The provision “exudes deference to the president in every clause,” the chief justice said.
He concluded that Mr. Trump’s proclamation, viewed in isolation, was neutral and justified by national security concerns. Chief Justice Roberts wrote it is “expressly premised on legitimate purposes: preventing entry of nationals who cannot be adequately vetted and inducing other nations to improve their practices.”
Even as it upheld the travel ban, the court’s majority took a momentous step. It overruled the Korematsu case, officially reversing a wartime ruling that for decades has stood as an emblem of a morally repugnant response to fear.
Chief Justice Roberts said Tuesday’s decision was very different.
“The forcible relocation of U.S. citizens to concentration camps, solely and explicitly on the basis of race, is objectively unlawful and outside the scope of presidential authority,” he wrote. “But it is wholly inapt to liken that morally repugnant order to a facially neutral policy denying certain foreign nationals the privilege of admission.”
“The entry suspension is an act that is well within executive authority and could have been taken by any other president — the only question is evaluating the actions of this particular president in promulgating an otherwise valid proclamation,” Chief Justice Roberts wrote.
Justices Anthony M. Kennedy, Clarence Thomas, Samuel A. Alito Jr. also joined the majority opinion.
In her dissent, Justice Sotomayor lashed out at Mr. Trump, also quoting many of the anti-Muslim statements. She noted that, on Twitter, he retweeted three anti-Muslim videos as president and tweeted that “we need a TRAVEL BAN for certain DANGEROUS countries.”
“Let the gravity of those statements sink in,” Justice Sotomayor said. “Most of these words were spoken or written by the current president of the United States.”
She dismissed the majority’s conclusion that the government succeeded in arguing that the travel ban was necessary for national security. She said that no matter how much the government tried to “launder” Mr. Trump’s statements, “all of the evidence points in one direction.”
Justice Sotomayor accused her colleagues in the majority of “unquestioning acceptance” of the president’s national security claims. Justice Ruth Bader Ginsburg joined Justice Sotomayor’s dissent. Justice Sotomayor accused the court of inconsistency, noting that a stray remark from a state commissioner expressing hostility to religion was the basis of a ruling this month in favor of a Christian baker who refused to create a cake for a same-sex wedding.
“Those principles should apply equally here,” she wrote. “In both instances, the question is whether a government actor exhibited tolerance and neutrality in reaching a decision that affects individuals’ fundamental religious freedom.”
In a second, milder dissent, Justice Stephen G. Breyer, joined by Justice Elena Kagan, questioned whether the Trump administration could be trusted to enforce what he called “the proclamation’s elaborate system of exemptions and waivers.”
Justice Kennedy agreed that Mr. Trump should be allowed to carry out the travel ban, but he emphasized the need for religious tolerance.
“The First Amendment prohibits the establishment of religion and promises the free exercise of religion,” he wrote. “It is an urgent necessity that officials adhere to these constitutional guarantees and mandates in all their actions, even in the sphere of foreign affairs. An anxious world must know that our government remains committed always to the liberties the Constitution seeks to preserve and protect, so that freedom extends outward, and lasts.”
The court’s decision, a major statement on presidential power, is the conclusion of a long-running dispute over Mr. Trump’s authority to make good on his campaign promises to secure the United States’ borders.
Only a week after he took office, Mr. Trump issued his first travel ban, causing chaos at the country’s airports and starting a cascade of lawsuits and appeals. The first ban, drafted in haste, was promptly blocked by courts around the United States.
A second version, issued two months later, fared little better, although the Supreme Court allowed part of it go into effect last June when it agreed to hear the Trump administration’s appeals from court decisions blocking it. But the Supreme Court dismissed those appeals in October after the second ban expired.
In January, the Supreme Court agreed to hear a challenge to Mr. Trump’s third and most considered entry ban, the one issued as a presidential proclamation. It initially restricted travel from eight nations — Iran, Libya, Syria, Yemen, Somalia, Chad, Venezuela and North Korea — six of them predominantly Muslim. Chad was later removed from the list.
The restrictions varied in their details, but, for the most part, citizens of the countries were forbidden from emigrating to the United States, and many of them are barred from working, studying or vacationing here. In December, the Supreme Court allowed the ban to go into effect while legal challenges moved forward.
The State of Hawaii, several individuals and a Muslim group challenged the latest ban’s limits on travel from the predominantly Muslim countries; they did not object to the portions concerning North Korea and Venezuela. They said the latest ban, like the earlier ones, was tainted by religious animus and not adequately justified by national security concerns.
The challengers prevailed before a Federal District Court in Hawaii and in San Francisco before a three-judge panel of the United States Court of Appeals for the Ninth Circuit.
The appeals court ruled that Mr. Trump had exceeded the authority 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 was not directly before the justices, the United States Court of Appeals for the Fourth Circuit, in Richmond, Va., blocked the ban on a different ground, saying it violated the Constitution’s prohibition of religious discrimination.