HOUSTON (AP) — Texas’ highest criminal court on Wednesday commuted the death sentence of a Mexican man after agreeing with findings that he was ineligible to be executed because of an intellectual disability.

The Texas Court of Criminal Appeals changed the death sentence that Juan Lizcano had faced to life in prison without the possibility of parole.

Lizcano, now 43, was convicted of capital murder in the November 2005 shooting death of 28-year-old Dallas Police Officer Brian Jackson.

Jackson had been responding to a domestic disturbance call at the home of Lizcano’s former girlfriend when he was shot. He had been on the Dallas police force for nearly five years.

Testimony at his trial showed that Lizcano had the communication skills of a 8- to 10-year-old and was about 16 when he left school in the 6th grade still unable to read.

The Dallas County district attorney’s office declined to comment on Wednesday’s ruling. It initially opposed efforts by Lizcano’s attorneys to overturn the death sentence, but last year agreed that the evidence showed Lizcano was intellectually disabled.

Lizcano’s attorneys, Debbie McComas and Stephanie Sivinski of the Haynes and Boone law firm, said they were thrilled with the ruling.

“The Texas criminal justice system worked in this case. Ultimately, the Dallas County District Attorney, the trial court, and now the state’s highest criminal court followed the law and did the right thing, even in the face of public pressure to execute Mr. Lizcano," they said in a statement.

The Supreme Court in 2002 barred the execution of intellectually disabled people, but it has given states some discretion to decide how to determine such disabilities. However, justices have wrestled with how much discretion to allow.

The Texas appeals court’s ruling came after the Supreme Court in 2017 said the state court used outdated standards to reach its decision in the case of another death row inmate, Bobby James Moore.

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 himself or herself; and whether evidence of deficiencies in either of those areas occurred before age 18.

In 2004, the Texas appeals court created additional factors, including whether an individual’s conduct showed leadership and whether a person could “hide facts or lie effectively.”

The high court has said these factors have no grounding in prevailing medical practice and invite lay stereotypes to guide assessment of such disability.