WASHINGTON (CBSNewYork/AP) — The Supreme Court upheld President Donald Trump’s travel ban in a 5-4 decision Tuesday.

The high court rejected the challenge that the policy discriminated against Muslims or exceeded the president’s authority, saying in its opinion that the order is “squarely within the scope of Presidential authority.”

READ MORE: 2nd Former Aide Accuses Gov. Andrew Cuomo Of Sexual Harassment, Governor Requests Independent Review

MORE: Full Coverage From CBS News

Trump responded to the decision on Twitter, saying “SUPREME COURT UPHOLDS TRUMP TRAVEL BAN. Wow!”

The White House also issued a statement from the president, who called the ruling “a tremendous victory for the American People and the Constitution.”

“The Supreme Court has upheld the clear authority of the President to defend the national security of the United States. In this era of worldwide terrorism and extremist movements bent on harming innocent civilians, we must properly vet those coming into our country,” the statement 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. Our country will always be safe, secure, and protected on my watch.”

Attorney General Jeff Sessions called the ruling “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, writing that presidents have substantial power to regulate immigration.

He wrote “the sole prerequisite” 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 also pointed out that the president ordered an evaluation of “every single country’s compliance with the information and risk assessment baseline” and then issued a proclamation with the findings “about the deficiencies and their impact.”

“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.

He also rejected the challengers’ claim of anti-Muslim bias and 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.

READ MORE: Black History Is Our History: World Champion Gymnast Wendy Hilliard Uses Her Own Experience To Encourage Next Generation Of Black Athletes To Succeed

In the dissent, Justice Sonia Sotomayor wrote based on the evidence in the case “a reasonable observer would conclude that the Proclamation was motivated by anti-Muslim animus.”

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

Senators on both sides of the aisle were quick to respond following the ruling.

“I still disagree with the decision and the outcome,” said Democratic New Jersey Sen. Corey Booker. “We just cannot walk away from the fact of how this all started, which was a president who said he wanted to ban Muslims from our country and we’re a nation who has had Muslims as part of our nation for our entire history.”

“This is not a Muslim ban, it’s not anything that President Obama didn’t do when he was president so I’m not surprised the Supreme Court ruled the way they did,” said Republican Texas Sen. John Cornyn. “I think he was trying to keep the country safe.”

The high court took the case after the State of Hawaii sued, arguing the order violates religious freedom laws and is motivated by hostility. Hawaii citied past comments from the president as proof of illegal discrimination based on religion.

In December, the justices allowed the ban to take full effect as the legal fight over it continued. The case was then heard by the high court in April.

The policy 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,” Trump said in a proclamation.

New York Gov. Andrew Cuomo released a statement, calling the ban a “gross violation of our American values.”

“This shameful and bigoted policy is nothing but a thinly veiled attempt to govern by hate and division and continue the federal government’s assault on immigrants. By upholding a policy rooted in Islamophobia, this ruling encourages and contributes to a culture of profiling and religious discrimination,” the statement continued.

In her own statement, New York Attorney General Barbara Underwood said in part that “despite today’s ruling, New York will continue to serve as a beacon to the world, welcoming people of all faiths, races, nationalities, and backgrounds.”

“This ban is institutionalized Islamophobia, promoted under the guise of national security. Banning people from our country on the basis of religion is an affront to our founding ideals. With this decision, the highest court in the land has sent a message of exclusion and division across the globe,” New York City Mayor Bill de Blasio said in a statement. “As our President tries to build walls, New York City will continue to welcome people from all over the world to our shores, from all faith traditions.”

MORE NEWS: Power Restored To Co-Op City After Elderly Woman Collapsed, Died Climbing Stairs To Apartment During Outage

(© Copyright 2018 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)