The death sentence for Bobby Moore has been commuted to life in prison by the Texas Criminal Court of Appeals.

This decision ends a legal battle that has lasted for decades.

Moore, now 60, has sat on death row for 39 years since he was sentenced for killing an elderly store clerk James McCarble during a robbery in Houston.

The issue for Moore’s lawyers has been the claim that he was too ‘intellectually disabled’ to be put to death.

The state’s Court of Criminal Appeals took up the matter twice and both times they decided he did not qualify as intellectually disabled, including once after the U.S. Supreme Court weighed in on the controversial topic.

However, when it went back for arguments to the High Court in February, the justices made a clearer distinction in ruling that Moore was intellectually disabled, The Texas Tribune reported.

That cleared the way for the Texas court to render the same judgment.

‘Having concluded that Applicant is a person with intellectual disability that is exempt from the death penalty, the Supreme Court has resolved Applicant’s claim in his favor,’ the Texas court wrote in its ruling Wednesday. ‘There is nothing left for us to do but to implement the Supreme Court’s holding.’

Cliff Sloan, one of Moore’s lawyers said it was vindication for his client.

‘We greatly appreciate that the Texas Court of Criminal Appeals has implemented the Supreme Court decision and has ensured that justice is done regarding the inappropriateness of the death penalty for Bobby Moore,’ Sloan said.

Since Moore was sentenced before the ‘life in prison without the possibility of parole’ was enacted, and prisoners were eligible for parole after 20 years, the Texas Tribune pointed out, he automatically qualifies for parole.