Editor's note: This story has been updated throughout.

The U.S. Supreme Court ruled in favor of a Texas death row inmate Tuesday, sending his case back to the Texas Court of Criminal Appeals and invalidating the state's current method of determining if a death-sentenced inmate is intellectually disabled and therefore ineligible for execution. Texas' method relies on decades-old medical standards and a controversial set of factors.

The high court's 5-3 ruling in the case of Bobby Moore, a 57-year-old man who has lived on death row for more than 36 years, said Texas’ refusal to use current medical standards and its reliance on nonclinical factors violates the Eighth Amendment, which prohibits cruel and unusual punishment. Justice Ruth Bader Ginsburg wrote the opinion, with Chief Justice John Roberts and Justices Samuel Alito and Clarence Thomas dissenting.

As the court has previously instructed, "adjudications of intellectual disability should be 'informed by the views of medical experts.' That instruction cannot sensibly be read to give courts leave to diminish the force of the medical community’s consensus," Ginsburg wrote.

The Texas Tribune thanks its sponsors. Become one.

Moore was convicted of capital murder and sentenced to death in July 1980, three months after he walked into a Houston supermarket with two other men and fatally shot James McCarble, the 73-year-old clerk behind the counter, according to Texas' brief to the high court.

In 2014, a Texas state court used current medical standards, which looks for deficits in intellectual and adaptive functioning that began as a child, to determine Moore was intellectually disabled and could not be executed. But the Texas Court of Criminal Appeals overruled the decision, claiming the lower court erred by using those standards instead of the state’s test.

The test, commonly known as the Briseno standard, was established by the Court of Criminal Appeals in 2004, two years after the U.S. Supreme Court ruled that executing the intellectually disabled was unconstitutional. The court defined the test using a medical definition from 1992 — which claims intellectual and adaptive functioning must be “related,” meaning Moore’s poor adaptive skills could be traced to something else, like an abusive childhood. The test also uses several other nonclinical factors (the Briseno factors) to help courts determine adaptive functioning. The Court of Criminal Appeals claimed, based on its test, that Moore doesn’t legally have the disability.

Included in the Briseno factors is a controversial reference to Lennie, a character from John Steinbeck’s novel “Of Mice and Men.” The Briseno opinion written by the Court of Criminal Appeals said most citizens might agree a person like Lennie, a childlike character who didn’t intend to kill a woman but simply didn’t understand his strength, should be exempt from execution. The state has argued the reference was an “aside.” Critics say it exemplifies the arbitrariness of defining intellectual disability in Texas.

In the opinion, Ginsburg faults Texas for using current medical standards in other criminal cases, but not with the death penalty.

“Texas cannot satisfactorily explain why it applies current medical standards for diagnosing intellectual disability in other contexts, yet clings to superseded standards when an individual’s life is at stake,” she wrote.

The Texas Tribune thanks its sponsors. Become one.

The Texas Court of Criminal Appeals ruled Moore was not intellectually disabled by looking at both intellectual and adaptive deficits. But the high court knocked down the ruling not only on adaptive functioning  — how he can learn new skills, etc. — but also on intellectual functioning as well. Previous court rulings have stated that when intellectual functioning is “borderline,” with an IQ at or around 70, the state must look into adaptive behavior. Moore’s IQ, 74, led the high court to rule that this was necessary, which is what triggered Roberts’ dissent.

Roberts agreed that the nonclinical Briseno factors are an “unacceptable method” of determining adaptive deficits but said the Texas Court of Criminal Appeals still performed its due diligence in determining Moore’s intellectual functioning.

“The Court overturns the CCA’s conclusion that Moore failed to present sufficient evidence of both inadequate intellectual functioning and significant deficits in adaptive behavior without even considering ‘objective indicia of society’s standards’ reflected in the practices among the States,” Roberts wrote. “The Court instead crafts a constitutional holding based solely on what it deems to be medical consensus about intellectual disability. But clinicians, not judges, should determine clinical standards; and judges, not clinicians, should determine the content of the Eighth Amendment. Today’s opinion confuses those roles.”

Moore’s case was the third time since 2002 that the high court considered the death penalty and the intellectually disabled. That year, justices ruled that executing people with intellectual disabilities is unconstitutional, but it left it up to the states to legally determine the condition. In 2014, the court weighed in on borderline cases, ruling that states can’t use an IQ below 70 as the sole way to define the disability.

Moore's case will now go back to the Texas Court of Criminal Appeals, which will re-evaluate the lower appeals court's recommendation that he is intellectually disabled and be granted relief.

The ruling was the Supreme Court’s second on a Texas death penalty case from this term. In February, justices ruled in favor of Duane Buck, agreeing that his case was prejudiced by an expert trial witness who claimed Buck was more likely to be a future danger because he is black. Buck’s case will go back through the lower courts and likely end in a new trial or lessened sentence.

More on Bobby Moore’s case:

Never miss a moment in Texas politics with our daily newsletter.