A federal court ruled this week that the state of Alabama cannot execute a death row prisoner by lethal injection because the man chose to die by nitrogen gas, a process that the state had not adequately finalized.

Alan Eugene Miller, a former delivery driver, was sentenced to death after killing three people while on the job in Birmingham in 1999.

Once on death row, he claims he chose to be executed by nitrogen hypoxia, a procedure approved by Alabama in 2018 as the state struggled to secure lethal injection drugs from wary pharmaceutical companies. According to him, the Alabama Department of Corrections then misplaced his paperwork.

“I didn’t want to be stabbed with a needle,” Miller once told a judge, recalling painful past experiences drawing blood.

Meanwhile, the state claimed Miller never requested to be killed with nitrogen and that he would be executed by lethal injection on September 22.

A federal judge sided with Miller on Monday, ruling that the state was not prepared to use the new nitrogen gas method, which had never been tried on an inmate in the state.

Miller would suffer “irreparable injury” if the execution went ahead, wrote judge Austin Huffaker Jr, because he would be “deprived of the ability to die by the method he chose and instead will be forced to die by a method he sought to avoid and which he asserts will be painful.”

The ruling means that the state cannot proceed with the execution using any method other than nitrogen gas without a court order.

State officials were unsure whether they were ready to use the process, which has been proposed as a more humane form of execution but has yet to be tested in the three states where it is legal, Alabama, Oklahoma, and Mississippi.

During a hearing on September 12, Alabama stated that there was a “very good chance” that the nitrogen process would be ready for Miller’s execution. Three days later, Alabama Department of Corrections Commissioner John Q. Hamm filed an affidavit stating the inverse.

“The ADOC cannot carry out a nitrogen hypoxia execution on September 22, 2022,” it stated.

It is unclear whether the state will appeal the decision

The state, like all those who use the death penalty, has struggled to find a safe and humane method of carrying out executions.

Doyle Lee Hamm’s execution was postponed in 2018 because executioners couldn’t find a vein for the lethal injection drugs after puncturing his skin 11 times over the course of hours.

This July, Joe Nathan James faced a similarly lengthy execution, with autopsy witnesses saying Alabama officials had to slice into the man’s skin to place an IV line, breaking state rules. According to experts, the new execution method is no better. For one thing, testing is ethically impossible due to the unusual combination of an execution using medical technology.

“There might not be any legitimate research. There is no way you could design an ethical research project… A human study will never be conducted. It serves no medical purpose and would never pass any kind of ethical scrutiny that would allow such a thing to happen “CNN spoke with Dr Joel Zivot, an associate professor of anesthesiology and surgery at Emory University.

States such as Oklahoma have dealt with botched lethal injection executions in which officials swapped drugs and inmates writhed in agony while strapped to gurneys.

Because pharmaceutical companies are often reluctant to sell their drugs for use in executions, states such as South Carolina have resorted to antiquated methods of execution such as the firing squad.