WASHINGTON (CBSDFW.COM/AP) — The Supreme Court is ending a long legal fight by ruling that a Texas death row inmate is intellectually disabled and thus may not be executed.

The justices ruled 6-3 Tuesday in the case of inmate Bobby James Moore.

Moore had been sentenced to death for the 1980 shotgun slaying of 72-year-old Houston supermarket clerk James McCarble.

His lawyers argued for years that Moore was intellectually disabled, but Texas’ top criminal appeals court rejected those claims, even after the Supreme Court strongly suggested that Moore could not be executed because of his intellectual limitations.

In that 2017 decision Justice Ruth Bader Ginsburg said, in her majority opinion, that the appeals court appeals court ignored current medical standards and required use of outdated standards when it decided Moore wasn’t mentally disabled.

In a twist, the Houston district attorney agreed with Moore that he should be spared the death penalty. Houston prosecutors originally persuaded a jury to sentence Moore to death.

(© Copyright 2019 CBS Broadcasting Inc. All Rights Reserved. The Associated Press contributed to this report.)