A convicted police killer who sued Alabama over its lethal injection method has been executed, but not before he cursed at the state and said: "I hate you."
As the procedure began on Thursday night, Torrey Twane McNabb, 40, raised both of his middle fingers in a show of defiance.
His lawyers had unsuccessfully sought to stop the execution since he was one of several inmates in an ongoing lawsuit challenging the humaneness of the state's lethal injection procedure.
McNabb was convicted of killing Montgomery Police officer Anderson Gordon in 1997. He shot Mr Gordon five times as the officer sat in his patrol car after arriving at a traffic accident McNabb caused while fleeing a bail bondsman, prosecutors said.
Mr Gordon's relatives said in a statement that the 30-year-old - known as "Brother" - was devoted to his family, his two children and his work as a police officer.
"Over 20 years ago, we lost a companion, a father, a brother and friend who only wanted to make a difference in his community," the statement read. "Although, the wounds of having a family member murdered can never be healed, through this tragedy, the Gordon family has remained strong and will continue to be resilient."
The inmates in the lawsuit have argued that the sedative midazolam does not reliably render a person unconscious before subsequent drugs stop their lungs and heart. They point to an execution last December during which an Alabama inmate coughed and heaved for the first 13 minutes of the procedure.
McNabb appeared to be breathing for the first 20 minutes of the 35-minute long procedure. He later appeared to move his head, grimace and raise his arms after two consciousness checks in which a guard pinches his arm, says his name and pulls back his eyelid - before eventually becoming still.
His family members and lawyers who witnessed the execution expressed repeated concerns to each other that he was still conscious during the lethal injection. "He's going to wake up," one of McNabb's family members whispered.
He was pronounced dead at 9.38pm local time, authorities said.
Alabama Commissioner Jeff Dunn said he was confident the movements after the second consciousness check were involuntary and that McNabb was not awake.
A lawyer for McNabb argued that it would be wrong to carry out the execution while proceedings continued in the lawsuit.
The state argued that the inmates are unlikely to prevail in their claims since the US Supreme Court has allowed other executions, including four in Alabama, to proceed using midazolam. The attorney general's office argued that McNabb had presented nothing new to justify a stay.
The US Supreme Court delayed the execution for more than two hours to consider McNabb's request for a stay, but ruled that the execution could proceed.