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

The Supreme Court ruled 5-4 Tuesday to uphold President Donald Trump’s ban on allowing travel from six countries in a major decision that inspired outrage from the court’s liberal justices. In a separate written dissent joined only by Justice Ruth Bader Ginsburg, Justice Sonia Sotomayor used Trump’s inflammatory rhetoric about Muslims to underscore the “stark parallels” between the majority opinion and one of the high court’s most shameful moments: Korematsu v. United States, the decision that upheld Japanese internment during World War II.

“A reasonable observer would conclude that the Proclamation was motivated by anti-Muslim animus,” Sotomayor wrote. “The majority holds otherwise 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.”

In the majority opinion, the justices explicitly overruled the 1944 Korematsu decision, but Justice Sotomayor rejected their arguments, saying that their actions “merely replaces one ‘gravely wrong’ decision with another”:

In the intervening years since Korematsu, our Nation has done much to leave its sordid legacy behind … Today, the Court takes the important step of finally overruling Korematsu, denouncing it as “gravely wrong the day it was decided.”…This formal repudiation of a shameful precedent is laudable and long overdue. But it does not make the majority’s decision here acceptable or right. By blindly accepting the Government’s misguided invitation to sanction a discriminatory policy motivated by animosity toward a disfavored group, all in the name of a superficial claim of national security, the Court redeploys the same dangerous logic underlying Korematsu and merely replaces one “gravely wrong” decision with another.

Chief Justice John G. Roberts wrote the majority opinion and dispensed with the religious debate in order to focus solely on whether Trump satisfied the demands of the Immigration and Nationality Act. In response, Sotomayor argued that Trump’s executive order should have been struck down based on the Establishment Clause of the First Amendment, which ensures that the government “cannot favor or disfavor one religion over another.”

In reaching that conclusion, Sotomayor flatly rejected the government’s request to ignore Trump’s multiple statements about Muslims and his earliest description of the executive order as a “total and complete shutdown” of Muslims entering the US. “Given President Trump’s failure to correct the reasonable perception of his apparent hostility toward the Islamic faith, it is unsurprising that the President’s lawyers have, at every step in the lower courts, failed in their attempts to launder the Proclamation of its discriminatory taint,” Sotomayor wrote.

Sotomayor compared Trump’s many broadsides against Islam, which comprise several paragraphs of her dissent, with the Court’s recent 7-2 ruling in Masterpiece Cakeshop v. Colorado Civil Rights Commission, noting, “The Court recently found less pervasive official expressions of hostility and the failure to disavow them to be constitutionally significant.” In the aftermath of the Masterpiece case, some legal experts had suggested that Justice Anthony Kennedy’s ruling, which depended on hostile statements made about religion by Colorado public officials, might foreshadow his rejection of Trump’s travel ban on similar grounds. It didn’t.

Sotomayor said Trump’s order fails to even clear the standard set by “rational-basis review,” the lowest bar of judicial scrutiny, because the “administrative review” undergirding it is too unconvincing in its aims and secretive in its process to distinguish the order from its public history as a Muslim ban.

She was similarly unconvinced by the government’s contention that the travel ban did not target Islam specifically, calling the inclusion of North Korea and Venezuela on the list of prohibited regions “insubstantial, if not entirely symbolic.” The order still “overwhelmingly targets Muslim-majority nations,” she wrote, adding that the US “remains wholly unable to articulate any credible national-security interest that would go unaddressed by the current statutory scheme absent the Proclamation.” If anything, the benefits of such an order would be redundant given existing immigration vetting protocols, she argued.

As a fine point in concluding her dissent, Sotomayor borrowed an approach popularized by her late, conservative colleague, Justice Antonin Scalia. When he especially disagreed with a Court ruling, he would dispense with traditional protocol and end his dissenting opinions without the usual “I respectfully dissent” in favor of some plainer language. Sotomayor opted for the harsher option: “Our Constitution demands, and our country deserves, a Judiciary willing to hold the coordinate branches to account when they defy our most sacred legal commitments. Because the Court’s decision today has failed in that respect, with profound regret, I dissent.”