The Supreme Court ruled Tuesday that Texas used the wrong standards in deciding that a death row inmate was not intellectually disabled and thus could be executed.

In a 5-3 decision written by Justice Ruth Bader Ginsburg, the court sent back the case of Bobby James Moore, who fatally shot a store clerk in a botched robbery in 1980. His long trip through the appeals courts has been marked by conflicting opinions on whether he is intellectually disabled.

Ginsburg wrote that the Supreme Court has given states leeway in making such determinations, but that it is not boundless.

Ginsburg said the court in Texas had used outdated standards for determining intellectual disability standards.

“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 wrote. She was joined by Justices Anthony Kennedy, Stephen Breyer, Sonia Sotomayor and Elena Kagan.

The Moore case has drawn attention because of Texas’ use of additional standards to judge a person’s “adaptive behavior,” another way of saying whether a person can go about daily life as others would.

A Texas judge likened the factors to the “Lennie” standard, a reference to Lennie Small, the gentle but deadly farmhand in John Steinbeck’s “Of Mice and Men.”

The judge wrote that most Texas citizens might agree that Lennie should be exempt from execution because of his lack of reasoning skills but that other killers might not be exempt.

At one of his rehearings, a judge found Moore to be intellectually disabled and ineligible for the death penalty. But the Court of Criminal Appeals reversed that, saying in part that the judge had used current medical standards about defining intellectual disabilities rather than the ones it had directed lower courts to use.

Chief Justice John Roberts dissented from the decision, along with Justice Clarence Thomas and Samuel Alito.