For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

The Supreme Court upheld President Donald Trump’s travel ban on Tuesday, allowing the government to block about 150 million people, most of them Muslim, from entering the United States.

The administration prevailed in blocking people from seven countries despite Trump’s history of anti-Muslim statements, which the parties challenging the ban cited as evidence that the policy was intended to fulfill Trumps campaign promise of a “Muslim ban.” The decision marks the first time the nation’s highest court has weighed in on one of the Trump administration’s central—and most controversial—policies.

In a 5-4 opinion, the court’s conservative majority found that the travel ban is within the president’s authority under current immigration law. The justices were unpersuaded by concerns that the ban represents religious discrimination in violation of the First Amendment. The court ruled, in an opinion written by Chief Justice John Roberts, that the law can stand even if it was partially motivated by prejudice, “so long as it can reasonably be understood to result from a justification independent of unconstitutional grounds.”

The court’s decision allows the ban to fully take effect. The lower courts may adjudicate it further, but Tuesday’s ruling is an unmistakable endorsement of the policy.

In a powerful dissent, Justice Sonia Sotomayor argued there is ample evidence to suggest that the travel ban is the realization of the Muslim ban that Trump promised during his presidential campaign, thinly disguised as a national security measure. “But this new window dressing cannot conceal an unassailable fact: the words of the President and his advisers create the strong perception that the Proclamation is contaminated by impermissible discriminatory animus against Islam and its followers,” she wrote.

Beyond the issue of religious discrimination, the case was a major showdown over the power of the president. It pitted Trump’s broad authority over immigration and national security against his history of animus toward Muslims. The administration, defended by Solicitor General Noel Francisco, defended the ban as a legal exercise of the president’s authority. The challengers—the state of Hawaii, the Muslim Association of Hawaii, and three Muslim individuals—countered that the ban both exceeds his authority and violates the Constitution’s prohibition on religious discrimination. They were represented by former Justice Department lawyer Neal Katyal, who framed the ban as an unconstitutional attack on a religious minority. Katyal drew attention to Trump’s statements about Muslims, including his campaign promise of a “total shutdown” on Muslims entering the country and his retweets of anti-Muslim propaganda videos as president. Katyal also argued that under current immigration law, a ban based on nationality exceeds the president’s authority.

A week into his presidency, Trump issued an executive order banning nationals of seven Muslim-majority countries from entering the United States, prompting protests at airports around the country and lawsuits by civil liberties groups. The order was quickly blocked in federal court. In March 2017, the administration issued a second version of the order, removing Iraq from the list of countries and scrapping a section that exempted religious minorities in the Muslim-majority countries—a carve-out that made the travel ban look particularly like a Muslim ban. Trump called this second version the “watered-down, politically correct version” of his travel ban. That order was likewise blocked by multiple judges. But before the Supreme Court could take the case, the administration issued a third and final order.

Unlike the previous two, this third order, issued in September, did not come with an end date. It banned most people from six Muslim-majority countries—Iran, Libya, Syria, Somalia, Chad, and Yemen—as well as North Koreans and some Venezuelan government officials. Chad was removed in April. The third ban contained more exceptions, meant to signal that the order was not a blanket ban. But during oral arguments before the Supreme Court, the government was unable to explain why so few applications for entry under these exemptions had been approved, signaling that the exemptions might be, as Justice Stephen Breyer put it in April, “just window dressing.”

During those oral arguments, the conservative justices strongly hinted that they would uphold the ban as part of the president’s national security authority. Roberts wondered whether a ruling against the ban would limit the president’s ability to respond adequately to an impending terrorism threat. Roberts also seemed skeptical that the nation’s immigration statutes limited the president’s authority to ban all nationals of certain countries from entering.

On the other side, liberal justice Elena Kagan wondered how far a court sanction of the ban could go—whether, for example, an openly anti-Semitic president could ban entry to Israelis if his advisers said it was necessary for national security. And all eyes were on perennial swing justice Anthony Kennedy, who ultimately sided with the conservative majority, as he has done consistently in close cases this term.

In her dissent, joined by Justice Ruth Bader Ginsburg, Sotomayor compared the opinion to the court’s infamous ruling upholding the Japanese internment camps during World War II. “In Korematsu, the Court gave ‘a pass [to] an odious, gravely injurious racial classification’ authorized by an executive order,” Sotomayor argued. “As here, the Government invoked an ill-defined national security threat to justify an exclusionary policy of sweeping proportion.”

She continued: “As here, the Government was unwilling to reveal its own intelligence agencies’ views of the alleged security concerns to the very citizens it purported to protect.” She noted that the Trump administration had not released a public version of its worldwide threat assessment that it claims is the justification for the travel ban. “And as here, there was strong evidence that impermissible hostility and animus motivated the Government’s policy.”