The Supreme Court, on Tuesday, upheld the third version of President Donald Trump’s travel ban—the one most trimmed and tailored to get by the Justices—but in doing so the majority made two crucial, counterbalancing moves. The first was to “assume” that the plaintiffs’ claims in the case, Trump v. Hawaii, were reviewable, despite the Trump Administration’s dangerous claim that the courts had nothing to say about such an order. The second marks a historic moment: the explicit renunciation and overruling of Korematsu v. United States, which has been a stain on this court and this country since it was wrongly decided, in 1944.

Fred Korematsu, who was born in California in 1919, challenged the mass internment of Americans, like him, with Japanese ancestry. He was arrested when he defied an order to report for confinement, and was sent to a camp with his family after he was convicted. The Court, shamefully, upheld that conviction, in what served as a ratification of the internment program as a whole. In his dissent, Justice Robert Jackson warned that, whatever the fears of wartime, “The principle then lies about like a loaded weapon, ready for the hand of any authority that can bring forward a plausible claim of an urgent need.” Despite revulsion and regret about the internment in the decades since, and also revelations that the government was dishonest about its security concerns, that decision had, technically, remained in place. Its echoes were one of the reasons that the travel ban raised such alarms.

For Chief Justice John Roberts, who wrote for the majority in Trump v. Hawaii, those resonances were too loud to ignore. In his opinion, he notes that the dissent had invoked Korematsu. He was referring to the opinion that Justice Sonia Sotomayor wrote, joined by Justice Ruth Bader Ginsburg. (There was a separate dissent by Justice Stephen Breyer, joined by Justice Elena Kagan. Roberts was joined by Justices Anthony Kennedy, Clarence Thomas, Samuel Alito, and Neil Gorsuch; Kennedy also wrote a somewhat provocative concurrence that seemed to decry the Administration’s policies while acknowledging Trump’s authority to execute them; Thomas wrote one saying that the plaintiffs’ case was even worse than Roberts said.) “Whatever rhetorical advantage the dissent may see” in raising Korematsu, Roberts writes, that decision has “nothing to do with this case. The forcible relocation of U. S. citizens to concentration camps, solely and explicitly on the basis of race, is objectively unlawful and outside the scope of Presidential authority. But it is wholly inapt to liken that morally repugnant order to a facially neutral policy denying certain foreign nationals the privilege of admission.” Largely because of what the majority accepted was a serious review process in the selection of the countries affected by the travel ban—currently Iran, Libya, Somalia, Syria, Yemen, North Korea, and, in a more limited way, Venezuela—purportedly based on grounds other than religion, and the existence of a waiver process, the decision found that “the entry suspension is an act that is well within executive authority and could have been taken by any other President—the only question is evaluating the actions of this particular President in promulgating an otherwise valid Proclamation.”

There is, though, a “however,” and with it a crucial moment for Roberts and the Court: “The dissent’s reference to Korematsu, however, affords this Court the opportunity to make express what is already obvious: Korematsu was gravely wrong the day it was decided, has been overruled in the court of history, and—to be clear—‘has no place in law under the Constitution.’ 323 U. S., at 248 (Jackson, J., dissenting).” That citation of “Jackson, J., dissenting” finally recognized the truth of one of the more famous dissents in the Court’s history—a dissent, one might say, no more. And, for the Americans who were interned, it is a small, late measure of justice.

Nevertheless, the travel ban was upheld, and Sotomayor’s strong dissent captures the fear that, while “finally overruling” Korematsu, which she calls a “shameful precedent,” is “laudable and long overdue,” one kind of Korematsu decision had been swapped for another. She points out “stark parallels” in the reasoning, noting that, “As here, the Government invoked an ill-defined national-security threat to justify an exclusionary policy of sweeping proportion . . . . As here, the exclusion order was rooted in dangerous stereotypes about, inter alia, a particular group’s supposed inability to assimilate and desire to harm the United States.” And, she adds, “as here, there was strong evidence that impermissible hostility and animus motivated the Government’s policy.” This is a recognition that the origin of the travel-ban executive order was not a security review but Trump’s search for a way to keep his campaign promise to institute a “a total and complete shutdown of Muslims entering the United States until our country’s representatives can figure out what the hell is going on.” (Indeed, when Trump first proposed the Muslim ban, as a candidate in late 2015, he said, “What I’m doing is no different than F.D.R.”) As a result, Sotomayor writes, the majority “merely replaces one ‘gravely wrong’ decision with another.”

The concerns Sotomayor raises are urgent ones; she also provides a model of why dissents matter. But one should take issue with that “merely.” Supreme Court precedents have a way of interacting, in a sort of constitutional synergy (or unconstitutional alchemy). The renunciation of Korematsu does say a good deal about what the Court does not, and will not, allow in upholding the revised travel ban. It does place limits on executive power. As long as Korematsu was in place, there was a danger that, despite its ill repute, this President, or a future one, would not scruple to use it. As Jackson said, Korematsu was still a loaded weapon, capable of firing. On Tuesday, the Supreme Court took that gun out of Donald Trump’s hands.