The Supreme Court has upheld President Trump's travel ban Tuesday. With a 5-4 vote, the court wrote in its opinion that the order is "squarely within the scope of Presidential authority."

The 5-4 decision Tuesday is the court's first substantive ruling on a Trump administration policy. The president reacted to news of the ruling, tweeting "Wow!"

SUPREME COURT UPHOLDS TRUMP TRAVEL BAN. Wow! — Donald J. Trump (@realDonaldTrump) June 26, 2018

Mr. Trump later hailed the ruling as a "tremendous victory for the American People and the Constitution."

Get Breaking News Delivered to Your Inbox

In a statement issued by the White House, he said, "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. As long as I am President, I will defend the sovereignty, safety, and security of the American People, and fight for an immigration system that serves the national interests of the United States and its citizens."

Meanwhile, Attorney General Jeff Sessions said the ruling was "critical to ensuring the continued authority of President Trump -- and all future presidents -- to protect the American people."

Chief Justice John Roberts wrote the majority opinion, joined by his four conservative colleagues. Roberts wrote that presidents have substantial power to regulate immigration. "The sole prerequisite," Roberts wrote, is "that the entry of the covered aliens 'would be detrimental to the interests of the United States.' The President has undoubtedly fulfilled that requirement here." Roberts pointed out that Mr. Trump had ordered an evaluation of every country's compliance with the risk assessment baseline and then issued the findings.

"Based on that review, he found that restricting entry of aliens who could not be vetted with adequate information was in the national interest," Roberts wrote.

Roberts also rejected the challengers' claim of anti-Muslim bias. But he was careful not to endorse either Trump's provocative statements about immigration in general and Muslims in particular.

"We express no view on the soundness of the policy," Roberts wrote.

However, CBS News' Jan Crawford cautioned on CBSN that it "would be a mistake to read this ruling as, Trump can say whatever he wants." The next case, the next issue -- perhaps Russia -- is a different case, and he could make remarks that could show insight into a different area of law.

The court may have signaled its eventual approval in December, when the justices allowed the policy to take full effect even as the court fight continued and lower courts had ruled it out of bounds.

Justice Sonia Sotomayor wrote in a dissent that based on the evidence in the case "a reasonable observer would conclude that the Proclamation was motivated by anti-Muslim animus." She said her colleagues arrived at the opposite result by "ignoring the facts, misconstruing our legal precedent, and turning a blind eye to the pain and suffering the Proclamation inflicts upon countless families and individuals, many of whom are United States citizens."

Justices Stephen Breyer, Ruth Bader Ginsburg and Elena Kagan also dissented.

In a tweet from the ACLU, the advocacy group said "this is not the first time the Court has been wrong, or has allowed official racism and xenophobia to continue rather than standing up to it."

They added, "History has its eyes on us -- and will judge today's decision harshly."

BREAKING: SCOTUS has upheld Trump’s Muslim ban. This is not the first time the Court has been wrong, or has allowed official racism and xenophobia to continue rather than standing up to it. History has its eyes on us — and will judge today’s decision harshly. #NoMuslimBanEver — ACLU (@ACLU) June 26, 2018

Ryan Mace of Amnesty International USA said in a statement following the ruling that the policy is "a catastrophe all around."

"Some of the people banned from this policy are fleeing conflicts that the United States has had a direct hand in creating or perpetuating, as is the case in Yemen and Syria. In those cases especially we are essentially lighting a house on fire and locking the escape door shut. This ban, and the anti-Muslim sentiment in which it originated, has no place in a country that claims to value human rights," Mace added.

Nihad Awad, Executive Director of the Council on American Islamic Relations (CAIR), said at a press conference that the Court's ruling was "extremely disappointing" to Muslims and "all people who believe in equal protection and equality."

Awad said the ruling now gives the Trump administration a "free hand to re-inject discrimination against a particular faith back into our immigration system."

CBS News

Read the opinion here:

Travel ban arguments

In April, Mr. Trump appeared likely to win his argument when the case was heard by the high court. Chief Justice John Roberts and Justice Anthony Kennedy both signaled support for the travel policy in arguments. The ban's challengers almost certainly needed one of those two justices in order to strike down the ban on travelers from several mostly Muslim countries.

The justices voted in December to allow the policy to take full effect pending their full consideration.

The Trump administration asked the court to reverse lower court rulings that would strike down the ban.

The Supreme Court also considered whether the president can indefinitely keep people out of the country based on nationality, and it also looked at whether the policy is aimed at excluding Muslims from the United States.

Kennedy challenged lawyer Neal Katyal, representing the challengers, about whether the ban would be unending. He said the policy's call for a report every six months "indicates there'll be a reassessment" from time to time.

The travel ban was the first Trump policy to undergo a full-blown Supreme Court review. The justices examined the third version of a policy that Mr. Trump first rolled out a week after taking office, triggering chaos and protests across the U.S. as travelers were stopped from boarding international flights and detained at airports for hours. The first version was blocked by courts and withdrawn. Its replacement was allowed to take partial effect, but expired in September.

The current version is indefinite and now applies to travelers from five countries with overwhelmingly Muslim populations — Iran, Libya, Somalia, Syria and Yemen. It also affects two non-Muslim countries, blocking travelers from North Korea and some Venezuelan government officials and their families. A sixth majority-Muslim country, Chad, was removed from the list in April after improving "its identity-management and information sharing practices," Mr. Trump said in a proclamation.

The administration argued that courts have no role to play because the president has broad powers over immigration and national security, and foreigners have no right to enter the country.

The challengers argued that his policy amounts to the Muslim ban that Mr. Trump called for as a candidate, violating the Constitution's prohibition against religious bias.