Moore was 20 years old in 1980 when he was involved with two others in the botched robbery of the Birdsall Super Market in Houston that ended with the shooting death of a 70-year-old store clerk. Less than three months later, Moore was sentenced to death for his role in the crime.

The high court’s decision also means that Texas inmate Bobby James Moore, who was originally sent to death row in 1980, will again have a chance to prove that he is ineligible for the death penalty. Moore’s lawyers say that his cognitive disabilities are so great that to execute him would violate the constitutional ban on cruel and unusual punishment.

The ruling was a strong rebuke, particularly to the state of Texas, which has long based such determinations on outdated science in concert with a set of subjective — if not simply stereotyping — standards that were largely based on a fictional character.

In a 5-3 decision, the U.S. Supreme Court on Tuesday concluded that current medical standards must be considered when determining whether a defendant facing the death penalty is intellectually disabled and thus barred from execution under the Eighth Amendment.

His case has been plagued from the start. Moore’s trial attorneys floated a fake alibi defense and failed to present exculpatory evidence that suggested the shooting was accidental. A federal judge found the misconduct so egregious that he ordered that Moore be resentenced. But Moore’s attorneys still failed to do any investigation that might have mitigated their client’s culpability — at a hearing they presented nothing about his childhood abuse or his serious learning deficits, evidence that could have convinced a jury to spare his life — and in February 2001, Moore was again sentenced to die.

Just over a year later, the Supreme Court ruled in Atkins v. Virginia that while “mentally retarded persons who meet the law’s requirements for criminal responsibility should be tried and punished when they commit crimes,” as Justice John Paul Stevens wrote for the majority, because of their “disabilities in areas of reasoning, judgment, and control of their impulses … they do not act with the same level of moral culpability that characterizes the most serious adult criminal conduct.” And such impairments “can jeopardize the reliability and fairness of capital proceedings.” Noting that a number of states already barred the practice, the court ruled that death must be taken off the table for the intellectually disabled.

But the court did not tell the states how to determine intellectual disability when making decisions about who should face capital punishment, which has led to some problems, notably in Texas.

Despite the court’s ruling in Atkins, Texas lawmakers have repeatedly failed to pass a statute that would codify that decision and outline the steps needed for courts to determine disability. Into that void walked the state’s highest criminal tribunal, the Court of Criminal Appeals. In a 2004 case involving a man named Jose Garcia Briseño, the court concluded that where legislators had failed to act, it had no choice but to impose some order.

“This court must now deal with a significant number of pending habeas corpus applications claiming that the death row inmate suffers from mental retardation and thus is exempt from execution,” the court wrote. “Recognizing that ‘justice delayed is justice denied’ to the inmate, to the victims and their families, and to society at large, we must act during this legislative interregnum to provide the bench and bar with temporary judicial guidelines in addressing Atkins claims.”

What the court came up with was a multipronged analysis for lower courts to use when considering appeals based on a claim of intellectual disability. While the court said the clinical definitions laid out by the American Association on Mental Retardation — now known as the American Association on Intellectual and Developmental Disabilities — must be considered, there was also an open question as to how to determine the “level and degree of mental retardation at which a consensus of Texas citizens would agree that a person should be exempted from the death penalty.” To determine a cutoff level — where individuals with higher functioning would theoretically still be eligible for death — the court turned not directly to experts in the field, but instead cobbled together a set of standards based in part on the deficits demonstrated by the fictional character Lennie Small from John Steinbeck’s “Of Mice and Men.”

In other words, the Court of Criminal Appeals crafted a set of criteria that included things “professionals would never use” to determine intellectual disability in order to ensure that some individuals who might be clinically disabled would nonetheless still be eligible for the death penalty, said Jordan Steiker, a professor of law at the University of Texas at Austin. The move was “pretty much in direct defiance of what the Supreme Court had held.”

Under the court’s criteria, Briseño, who had been convicted of killing a county sheriff, did not qualify as intellectually deficient and his death sentence was upheld. After additional legal wrangling, nearly 10 years later Briseño’s sentence was reduced to life in prison.

Moore filed an appeal claiming that he was intellectually disabled not long after the Supreme Court handed down its Atkins decision, but it was not considered until 2014, when a District Court judge held an evidentiary hearing on the matter. Ruling in Moore’s favor, the judge concluded that under the most current medical standards Moore was ineligible for execution. The court recommended that his sentence be vacated.

The CCA overruled that decision, however, finding that the judge had not adhered to its Briseño standard — in part because in Moore’s case the court had used the updated, 2011 clinical standards employed by the AAIDD and not the 1992 standards the CCA had relied upon. “Although the mental-health fields and opinions of mental-health experts inform the factual decision, they do not determine whether an individual is exempt from execution,” the court wrote.

In Moore’s case, the court essentially ignored his serious, lifelong deficits — he failed the first grade twice and every grade thereafter until he dropped out in the ninth grade; he had to be drilled daily by teachers in order to understand concepts such as days of the week, months of the year, and how to tell time — in favor of what they determined showed he was higher functioning — including that he mowed lawns for money and knew how to play pool and dominoes.

It is with the CCA’s conclusions that the Supreme Court has disagreed. Writing for the court, Justice Ruth Bader Ginsburg noted that in a 2014 ruling in a Florida case that also affirmed its Atkins decision, the court had instructed that decisions about who is intellectually disabled should be “informed by the views of medical experts,” which “cannot sensibly be read to give courts leave to diminish the force of the medical community’s consensus,” as the CCA had done in denying Moore’s appeal.

Further, she wrote that the additional standards the court had devised in Briseño — those making up the so-called Lennie Standard — “are an invention of the CCA untied to any acknowledged source.” Refusing to rely on information from the medical community and employing these fictionalized standards creates an “unacceptable” risk that an intellectually disabled person would be executed.

Moore’s case now moves back to the CCA for further consideration; whether they will agree outright that he should be resentenced to life in prison is unclear. The court’s ruling could also prompt additional appeals by other Texas death row inmates whose claims of intellectual disability have been denied under the CCA’s unconstitutional Briseño standard.

Notably, there was at least one judge on the CCA, Elsa Alcala, who anticipated that the court’s standard was not sufficient to pass constitutional muster. “This court is required to uphold the federal Constitution as it has been interpreted by the Supreme Court,” she wrote in a lengthy dissent in Moore’s case. “Doing what we have always done simply because the legislature has not told us to do it otherwise is not the right answer.”