The U.S. Supreme Court has ruled Alabama can execute a death row inmate who claimed to be mentally incompetent and was granted a stay in 2016.

Vernon Madison, 66, is one of Alabama's longest-serving death row inmates. He was convicted in the April 1985 slaying of Mobile police officer Cpl. Julius Schulte.

In May 2016, Madison was set to die by lethal injection, but hours after the scheduled execution the U.S. Supreme Court issued a ruling upholding a lower court's stay.

Monday, the U.S. Supreme Court unanimously reversed that decision, meaning Madison is competent and can be executed. "More than 30 years ago, Vernon Madison crept up behind police officer Julius Schulte and shot him twice in the head at close range," the ruling states.

Madison faced a state competency hearing before his execution, where he claimed several strokes he recently suffered affected his mental status and made him unable to remember his crimes or remember that he was on death row. The trial court denied Madison's petition, and said the execution could proceed.

But then the 11th Circuit Court of Appeals ruled Madison was incompetent and he could not be executed.

"Testimony from each of the psychologists who examined Madison supported the court's finding that Madison understands both that he was tried and imprisoned for murder and that Alabama will put him to death as punishment for that crime," Monday's ruling states.

The nation's highest court has never ruled in about executions involving someone who doesn't remember his crime.

Justice Stephen Breyer wrote in a dissenting opinion about the issues surrounding executions. "...we may face ever more instances of state efforts to execute prisoners suffering the diseases and infirmities 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."

Madison was convicted and sentenced to death in both 1985 and 1990, but both times an appellate court sent the case back-- first for a violation involving race-based jury selection, and then based on improper testimony from an expert witness for the prosecution. In 1994, Madison was tried for a third time and convicted.

The jury recommended a life sentence, but the judge overrode the recommendation and sentenced him to death. Earlier this year, the state legislature threw out the judicial override law, but kept the rule allowing juries to send prisoners to death on a 10-2 vote.

Alabama Attorney General Steve Marshall said Monday in a press release, "Today's unanimous decision of the Supreme Court confirms the State's argument that Vernon Madison is competent to be executed for the murder he committed more than 30 years ago."

He said, "The Supreme Court correctly overturned the federal appeals court ruling blocking Madison's execution on the grounds he did not remember the crime he committed due to health reasons. Accordingly, the State will pursue a new execution date as soon as possible...Hopefully, the Supreme Court's wisdom will continue to prevail and allow Alabama executions to go forward."

Attorneys from the Equal Justice Initiative are representing Madison.

Angie Setzer, a lawyer who works with the program, said, "The U.S. Supreme Court expressly did not decide whether it is appropriate for the State of Alabama to execute Mr. Madison, rather the Court ruled that relief under the restrictions governing federal habeas review is not appropriate. We are reviewing next steps in light of this ruling."