The U.S. Supreme Court on Tuesday upheld the Trump administration’s travel restrictions on citizens from five Muslim countries, handing President Donald Trump a victory in enforcing one of his most controversial policies.

In a 5-4 split decision, the high court justices ruled that the president has the constitutional authority under U.S. immigration laws to limit travel from foreign countries over national security concerns, as the administration has argued.

​Chief Justice John Roberts delivered the majority opinion, writing that Trump’s September 2017 executive order restricting travel is “squarely within the scope of presidential authority” under U.S. immigration laws.

The president has “undoubtedly fulfilled” the requirement under the 1965 Immigration and Nationality Act that the entry of the targeted foreign travelers “would be detrimental to the interests of the United States,” Roberts wrote.

The chief justice also dismissed arguments of the challengers — the state of Hawaii, the Hawaii Muslim Association and three residents — that the travel restrictions violated the establishment clause of the U.S. Constitution’s First Amendment, which bars favoring one religion over another.

Opposition in and out of court

Unsurprisingly, the court’s four liberal justices dissented from Tuesday’s ruling.

Justice Sonia Sotomayor likened it to a 1944 Supreme Court decision that affirmed the U.S. government’s authority to place Japanese-Americans in military internment camps during World War II.

“History will not look kindly on the court’s misguided decision today, nor should it,” Sotomayor wrote.

Under the travel ban, issued in September after courts blocked its two earlier permutations, citizens of five Muslim countries — Iran, Libya, Somalia, Syria and Yemen — as well as North Koreans and some Venezuelan officials — are barred from traveling to the United States.

Chad, another predominantly Muslim nation, was initially on the list, but was dropped in April after the U.S. government said the country had complied with its information-sharing requirements.

The decision caps nearly 17 months of intense court battles between an administration determined to fiercely defend the president’s travel orders on grounds of national security and executive authority and detractors who characterized it as an ideologically inspired “Muslim ban.”

In a statement, Trump called the ruling “a tremendous victory for the American People and the Constitution.”

“In this era of worldwide terrorism and extremist movements bent on harming innocent civilians, we must properly vet those coming into our country,” Trump said.

There is no evidence that immigrants and foreign travelers in general — and specifically from the countries singled out by the executive order — are more likely to pose a threat to national security than native-born Americans.

Muslim Advocates, a Washington-based advocacy organization, said that with its ruling, the court affirmed “Trump's bigoted Muslim ban” and has “given a green light to religious discrimination and animus.”

Getting it right

Originally issued in January 2017, the travel order underwent two iterations amid myriad legal challenges before its final version landed before the justices last fall.

The first travel order imposed a 90-day ban on travelers from seven Muslim countries, a 120-day suspension on all refugee admissions, and a permanent prohibition on Syrian refugees.

The second ban, signed on March 6, 2017, dropped Iraq, a U.S. ally, from the list of targeted countries but was blocked by federal judges before it went into effect, prompting the administration to appeal to the Supreme Court last June. The justices agreed to hear arguments in the case in October, while allowing a partial implementation of the order.

But the administration preempted the hearing, rolling out yet another travel order in September, this time dropping Sudan and adding Chad, North Korea and Venezuela, making it more difficult to challenge the order as a religiously motivated ban targeting Muslims.

The state of Hawaii, the Muslim Association of Hawaii and three residents challenged the third ban.

That led the administration to once again appeal the case to the Supreme Court. In December, the high court allowed the administration to fully enforce the ban while legal challenges continued.

The plaintiffs argued through multiple levels of federal court that Trump's statements, including a campaign call to ban all Muslims from entering the United States, showed the travel ban was a method of excluding Muslims. Multiple lower court judges cited those statements when blocking the government from instituting the bans.

Justice Sotomayor cited that argument in her dissent, saying, "a reasonable observer would conclude that the Proclamation was driven primarily by anti-Muslim animus, rather than by the Government's asserted national-security justifications."

But in the majority opinion, Roberts dismissed such conclusions about Trump's outside statements, saying it is possible to otherwise explain the president's policy and that the travel ban "has a legitimate grounding in national security concerns, quite apart from any religious hostility."

Omar Jadwat, a lawyer with the American Civil Liberties Union who argued to the Supreme Court that the travel restrictions were discriminatory, called Tuesday's ruling a “great failure by the Supreme Court.”

“Thousands of Muslims in United States and abroad have been harmed. Thousands more will continue to be harmed for as long as this ban remains in effect,” Jadwat told reporters by phone, adding that the ruling “is just in the most basic way contrary to what we, as a nation, stand for.”

He implored Congress to intervene and “overrule” the Trump administration with a new law. But federal lawmakers are already embroiled in a legislative stalemate over other immigration issues, making this an unlikely option.

Kristie De Peña, a lawyer and director of immigration at the libertarian Niskanen Center, said the court’s ruling could lead to further travel bans.

“I can say almost without question that this will embolden the administration to ban additional, the same, or new populations,” she said. “It’s probably a matter of when now, not if.”