The Supreme Court today (June 26) ruled to uphold the Trump administration’s “Muslim ban,” the current iteration of which sought to prohibit entry into the United States for nationals of Chad, Iran, Libya, North Korea, Somalia, Syria, Venezuela and Yemen. Six of these countries feature populations that are predominantly Muslim; Chad was removed from the list in April.

In Trump v. Hawaii, the plaintiffs—the state of Hawaii, the Muslim Association of Hawaii and three people whose family members where denied entry into the country—argued that the president’s third version of the divisive executive order violates both the Immigration and Nationality Act and the Establishment Clause of the First Amendment, which prevents the government from enacting laws “respecting an establishment of religion.” The U.S. District Court for the District of Hawaii agreed with the plaintiffs, and the U.S. Court of Appeals for the Ninth Circuit did, too.

But the conservative-leaning SCOTUS reversed the lower courts’ rulings 5 to 4, saying that the Trump administration has a compelling reason for the ban. From the court opinion written by Chief Justice John Roberts: “…the government has set forth a sufficient national security justification to survive rational basis review.” The opinion also concludes that Trump did not overstep his authority under current immigration law.

Justice Stephen Breyer wrote a dissenting opinion, with Justice Elena Kagan concurring. In it, he writes that if the government actually applied the proclamation as written—with an actual exemption and waiver granting process that bolsters it’s national security claims—it wouldn’t be a violation of the law. But as it as applied, the government is excluding people from entry on the basis of their religion and visa type. From the opinion:

I would, on balance, find the evidence of anti-religious bias, including statements on a website taken down only after the president issued the two executive orders preceding the proclamation, along with the other statements also set forth in Justice Sotomayor’s opinion, a sufficient basis to set the proclamation aside.

Justice Sonia Sotomayor’s dissenting opinion—joined by Justice Ruth Bader Ginsburg—goes straight to the heart of the matter:

Based on the evidence in the record, a reasonable observer would conclude that the proclamation was motivated by anti-Muslim animus. That alone suffices to show that plaintiffs are likely to succeed on the merits of their Estab­lishment Clause claim. The majority holds otherwise by ignoring the facts, misconstruing our legal precedent, and turning a blind eye to the pain and suffering the procla­mation inflicts upon countless families and individuals, many of whom are United States citizens. Because that troubling result runs contrary to the Constitution and our precedent, I dissent.

Advocacy groups are pushing back against the decision, organizing rallies, putting in into a broader historical context and pledging to continue the fight.