The supreme court on Tuesday sided with a Texas death row inmate who claims he should not be executed because he is intellectually disabled.

The justices, by a 5-3 vote, reversed a Texas appeals court ruling that said inmate Bobby James Moore was not intellectually disabled.

Justice Ruth Bader Ginsburg said in her majority opinion that Texas’s top criminal appeals court ignored current medical standards and required use of outdated criteria when it decided Moore isn’t mentally disabled. That ruling removed a legal hurdle to Moore’s execution for the shotgun slaying of a Houston grocery store clerk in 1980.

“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,” Ginsburg said.

The decision was the second this term in which the high court has ruled for a Texas death row inmate. In February, the justices said race improperly tainted inmate Duane Buck’s death sentence.

Chief Justice John Roberts dissented, along with Justices Samuel Alito and Clarence Thomas. Roberts agreed that the Texas court used the wrong factors to determine mental disability. But he said the court also made a separate and independent determination about Moore’s intellectual abilities, finding they were not low enough to warrant a finding he was mentally disabled.

“Clinicians, not judges, should determine clinical standards,” Roberts said. “And judges, not clinicians, should determine the content of the eighth amendment.”

The supreme court held in 2002 that people convicted of murder who are intellectually disabled cannot be executed. The court gave states some discretion to decide how to determine intellectual disability. The justices have wrestled in several more recent cases about how much discretion to allow.

In 2014, the court ruled unconstitutional a Florida law that barred any other evidence of intellectual disability if an inmate’s IQ was over 70.

Texas looks at three main points to define intellectual disability: IQ scores, with 70 generally considered a threshold; an inmate’s ability to interact with others and care for themselves and whether evidence of deficiencies in either of those areas occurred before age 18.

The case is Moore v Texas, 15-797.