Image copyright Reuters Image caption Vernon Madison was sentenced to death for killling an Alabama officer

The US Supreme Court has halted the planned execution of an Alabama inmate at the last minute because his lawyers say he is suffering from dementia.

Vernon Madison's attorneys argued the 67-year-old is unable to remember the 1985 killing of a police officer that landed him on death row.

Madison was sentenced to death for killing officer Julius Schulte in the city of Mobile.

His execution was delayed to provide more time to assess his mental status.

The US Supreme Court previously ruled that inmates on death row must have a "rational understanding" of why they are about to be executed.

Madison's legal team said he had several strokes that left his memory impaired, that he is legally blind, and he cannot walk without a walker.

"His mind and body are failing," his lawyers wrote.

Attorney Bryan Stevenson said they were "thrilled" by the ruling and killing Madison would have been "unnecessary and cruel", reports the Associated Press.

Madison was locked up for shooting and killing Schulte when the officer came to intervene in a domestic dispute between Madison and his girlfriend.

He shot the officer in the back of the head twice while he was sitting in his car.

Madison has been held in solitary confinement for 30 years awaiting his execution.

His death by lethal injection was planned for 18:00 local time on Thursday and would have been the second scheduled execution in the United States this year.