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.
Fewer visas have been issued to people from the targeted countries, and the number of refugees has fallen to a historical low.
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.