Chief Justice John Roberts likely saved Vernon Madison’s life. He also may have saved the Eighth Amendment. On Wednesday morning, Roberts joined the Supreme Court’s liberal justices in Madison v. Alabama, an important death penalty decision affirming that states may not execute inmates who are unable to understand their punishments due to disorders like dementia. The ruling bolsters constitutional protections against executions for prisoners who suffer mental disabilities while cementing Roberts’ role as the court’s new swing justice.

Madison was sentenced to death for killing an Alabama police officer in 1985. Today he is nearly 70 years old and has spent 33 years in solitary confinement. Following a series of strokes, he has severe cognitive impairment due to vascular dementia. He struggles to walk, speak, or process basic information. Because of these ailments, Madison can no longer remember his 1985 crime.

Alabama still wants to kill him. Madison’s attorney, famed civil rights advocate, Bryan Stevenson countered that the Eighth Amendment prohibits his execution. In 2007’s Panetti v. Quarterman, the Supreme Court ruled that the government may not execute an individual whose “mental state is so distorted by a mental illness” that he lacks a “rational understanding” of the “rationale for [his] execution.” Stevenson claimed that, under Panetti, lethal injection would be unconstitutionally “cruel and unusual.”

Alabama argued otherwise, noting that Panetti specifically addresses inmates who suffer “gross delusions.” Madison, prosecutors claimed, experienced dementia, not delusions, and is thus unprotected by Panetti. The central question for the Supreme Court in this case, then, is whether the Eighth Amendment bars the execution of individuals whose dementia (not delusions) impede a “rational understanding” of the reason for their execution.

In her majority opinion, Elena Kagan easily concluded that it does. Relying on Panetti, Kagan first reasoned that an inmate’s failure to remember his criminal act does not by itself render him immune from execution. She then wrote, however, that “such memory loss still may factor into the ‘rational understanding’ analysis that Panetti demands.” If memory loss “combines and interacts with other mental shortfalls to deprive a person of the capacity to comprehend” his death sentence, “then the Panetti standard will be satisfied.”

Kagan then held that it doesn’t matter if these “mental shortfalls” stem from delusions, dementia, or some other disorder. Courts must “look beyond any given diagnosis to a downstream consequence”—whether a disorder can “so impair the prisoner’s concept of reality” that he cannot “come to grips with” the meaning of his punishment. Both dementia and delusion “come in many shapes and sizes, and not all will interfere with the understanding that the Eighth Amendment requires.” Courts must gauge “disorientation and cognitive decline” to determine whether execution is constitutional; they cannot simply look to a prisoner’s formal diagnosis.

Does that mean Alabama may not lawfully kill Madison? That remains unclear. Kagan noted that the Alabama court that approved Madison’s execution held only that “the evidence does not support that Mr. Madison is delusional.” She directed the court to reevaluate the case in light of Wednesday’s holding, to disregard evidence in the record that “reflects an incorrect view of the relevance of delusions or memory,” and to consider supplementing the record in light of the new decision. The implication here is obvious: Madison is likely too ill to be executed constitutionally, and if the Alabama court disagrees, it better give a really good reason.

Justices Samuel Alito, Clarence Thomas, and Neil Gorsuch dissented. (Justice Brett Kavanaugh did not participate because he was not on the court during oral arguments.) Alito accused the majority of “mak[ing] a mockery” of the court’s rules, because Stevenson did not initially present Madison’s case as a straight elucidation of Panetti. (Kagan dismissed his gripes as “high dudgeon.”) Alito’s dissent has more to do with the justice’s long-standing disgust with attorneys who oppose the death penalty than with the legal issues at hand.

The big question here is why Roberts crossed ideological lines to support Madison. There are a few possibilities. First, if Roberts voted with the conservative bloc, the court would’ve split 4–4, leaving in place a lower court order permitting Madison’s execution. The chief justice hates stalemates, and during oral arguments it appeared that Roberts was trying to avoid one, goading Stevenson to agree that the case could be decided on narrow grounds by following Panetti. He then pushed Alabama’s deputy attorney general to concede that Madison’s dementia may shield him from execution under Panetti, even though he isn’t delusional. These concessions, extracted by Roberts’ masterful questioning at oral arguments, formed the bedrock of Kagan’s opinion.

But there’s a wrinkle here: Roberts dissented from Panetti, disagreeing with its interpretation of the Eighth Amendment. Has Roberts merely embraced Panetti as precedent, even if he still thinks it’s wrong? Perhaps. But I have another theory. In 2015, the Yale Law Journal published a pathbreaking article by Michael Clemente asserting that the Eighth Amendment, as originally understood, provides robust protections against the execution of the mentally disabled. Citing a wealth of historical documents, Clemente made a compelling case that the Framers, in drawing up the Eighth Amendment, defined “insanity” much more broadly than the Supreme Court has in the death penalty context. The court, Clemente argued, should restore this “more generous standard” for “the level of mental impairment” required to forbid execution.

Clemente is now a Roberts clerk. We may never know if he influenced his boss in Madison. But Roberts’ vote on Wednesday reflects a significant evolution in his interpretation of the Eighth Amendment. And the chief justice’s enlightenment may well spare the life of an elderly, disabled inmate currently sitting on Alabama’s death row.