The U.S. Supreme Court on Monday overturned a lower court ruling that an Alabama man convicted of killing a police officer in 1985 was no longer legally eligible to be executed because strokes wiped out his memory of committing the murder.

The nine justices ruled unanimously that Alabama can execute 67-year-old Vernon Madison, who has spent decades on death row. They said Supreme Court precedent had not established "that a prisoner is incompetent to be executed because of a failure to remember his commission of the crime."

Madison has suffered several strokes in recent years, resulting in dementia and memory impairment, court papers said. He is legally blind, cannot walk on his own and speaks with a slur.

Liberal Justice Stephen Breyer, a death penalty critic, wrote in a separate opinion that Madison's case illustrated "the unconscionably long periods of time that prisoners often spend on death row awaiting execution."

The amount of time condemned inmates spend on death row has increased from seven years in 1987 to more than 19 years in 2017, Breyer said, meaning the justices will face more cases of states trying to execute prisoners suffering diseases of old age.

"And we may well have to consider the ways in which lengthy periods of imprisonment between death sentence and execution can deepen the cruelty of the death penalty while at the same time undermining its penological rationale," Breyer wrote.

Alabama had appealed a March federal appeals court ruling that Madison could not be executed because his memory loss had left him unable to understand the connection between his crime and the punishment he is due to receive.

Madison shot Julius Schulte, a police officer in Mobile, twice in the back of the head as Schulte supervised Madison's move out of his former girlfriend's house, according to court papers.

Madison, who is black, was sentenced to death in 1994 in his third trial after his first two convictions were thrown out on appeal for racial discrimination in jury selection and other prosecutorial misconduct.

After his execution date was set for May 2016, Madison's attorneys filed a court challenge saying he was not competent to be put to death because he could not remember committing the murder. A state court and a lower federal court denied the request.

But the Atlanta-based 11th U.S. Circuit Court of Appeals held in a 2-1 ruling that Madison could not be executed, saying the evidence showed he has a serious mental disorder resulting in dementia and believes he did not kill anyone.

"A finding that a man with no memory of what he did wrong has a rational understanding of why he is being put to death is patently unreasonable," that court wrote.

(Reporting by Andrew Chung; Editing by Will Dunham)