The 5-4 ruling, with the conservative justices in the majority and the liberal justices dissenting, ended a fierce fight in the courts over whether the policy amounted to an unlawful Muslim ban, while confirming broad presidential powers over immigration and national security policy.
Trump quickly claimed "profound vindication" after lower courts had blocked his travel ban announced in September, as well as two prior versions, in legal challenges brought by the state of Hawaii and others.
Trump has said the travel ban is needed to protect the US against attacks by Islamist militants.
The ruling, denounced by civil rights groups and Democrats as well as protesters outside the courthouse, empowers Trump as he is embroiled in controversy over his approach toward illegal immigration along the US-Mexican border.
Facing intense criticism, Trump retreated last week on his administration's practice of separating the children of immigrants from their parents when families were detained illegally entering the US.
The Supreme Court held that the challengers had failed to show that the travel ban violated either US immigration law or the US Constitution's First Amendment prohibition on the government favoring one religion over another.
In remarks at the White House, Trump hailed "a tremendous victory for the American people and for our Constitution."
"We have to be tough, and we have to be safe, and we have to be secure. At a minimum, we have to make sure that we vet people coming into the country," the Republican president said, referring in a statement to "this era of worldwide terrorism and extremist movements bent on harming innocent civilians."
The ban prohibits entry into the US of most people from Iran, Libya, Somalia, Syria and Yemen. The ruling affirmed broad presidential discretion over who is allowed to enter the United States. Trump could potentially add more countries to the ban.
Newspaper headline: SC upholds Trump’s travel ban