In a 5-4 decision along partisan lines, the justices reversed a series of lower court decisions that struck down the ban as Illegal -- giving the White House its first high court victory on the merits of a presidential initiative.
"SUPREME COURT UPHOLDS TRUMP TRAVEL BAN. Wow!" Trump tweeted.
"In this era of worldwide terrorism and extremist movements bent on harming innocent civilians, we must properly vet those coming into our country," Trump added. "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."
More than 150 million people in Iran, Libya, Somalia, Syria and Yemen are affected by the ruling. Chad, also a majority-Muslim nation, was removed from the list in April. North Korea and Venezuela are not part of the legal battle.
Chief Justice John Roberts argued the president has "ample power" to impose entry restrictions and insisted the ban was within the scope of Trump's power. He also rejected claims it has an anti-Muslim bias.
"The text says nothing about religion. Plaintiffs and the dissent nonetheless emphasize that five of the seven nations currently included in the Proclamation have Muslim-majority populations," Roberts wrote for the majority.
"Yet that fact alone does not support an inference of religious hostility, given that the policy covers just 8 percent of the world's Muslim population and is limited to countries that were previously designated by Congress or prior administrations as posing national security risks."
Justice Sonia Sotomayor quoted Trump's own words in her dissent, saying his travel ban is merely a version of the "Muslim ban" he proposed during his campaign.
"It [the court's decision] leaves undisturbed a policy first advertised openly and unequivocally as a 'total and complete shutdown of Muslims entering the United States' because the policy now masquerades behind a façade of national-security concerns," Sotomayor wrote.
"But this repackaging does little to cleanse Presidential Proclamation of the appearance of discrimination that the President's words have created," she argued, adding, "a reasonable observer would conclude that the Proclamation was motivated by anti-Muslim animus."
Joined by Justice Ruth Bader Ginsburg in her dissent, Sotomayor said the panel's conservative justices "ignored" the facts, "misconstrued" legal precedent and turned "a blind eye to the pain and suffering" the ruling puts on "countless families and individuals, many of whom are United States citizens."
Justices Stephen Breyer and Elena Kagan were the court's other two dissenters.
The decision was immediately criticized by several organizations, including Amnesty International, which called the Supreme Court ruling a "hateful policy."
"This ban, and the anti-Muslim sentiment in which it originated has no place in a country that claims to value human rights," the advocacy group said.
Democratic National Committee Chair Tom Perez called the ruling an "outright attack" on the Muslim community. The American Civil Liberties Union said history would judge Tuesday's decision "harshly."
The high court upheld the third version of Trump's ban, after the previous two were effectively shut down in federal court.