MONTGOMERY, Ala. — Strapped to a gurney, defiant cop-killer Torrey Twane McNabb raised both middle fingers and unleashed a profanity laden curse at the state of Alabama before falling unconscious and succumbing to the executioner's deadly cocktail of drugs.

McNabb, who had challenged the state's execution drug method, was put to death Thursday night for killing a police officer in 1997.

Torrey McNabb was convicted of the 1997 murder of Montgomery Police Officer Anderson Gordon III.

It was Alabama's fifth execution since January 2016 and took place almost exactly 20 years after McNabb shot and killed Montgomery Police Officer Anderson Gordon III. 

McNabb expressed defiance shortly before the grim ritual began at 8:56 p.m. Thursday night, addressing family members through a glass window.

"Mom, sis, look at my eyes," he said. "I've got no tears in my eyes. I'm unafraid . . . to the state of Alabama, I hate you m-----f-----s. I hate you."

McNabb raised his middle fingers toward witnesses galleries as the execution began. He appeared to be breathing for the first 20 minutes of the execution and moved slightly.

More: Last-minute drama as Arkansas carries out nation’s first double execution since 2000

More: Georgia carries out its first execution in 2017

At 9:17 p.m., McNabb raised his right arm and rolled his head in a grimace before falling back on the gurney. Witnesses in the room — including McNabb's two sisters and two attorneys — expressed concerns he was not unconscious.  

He was pronounced dead at 9:38 p.m. after an execution that lasted approximately 35 minutes. Alabama Department of Corrections Commissioner Jeff Dunn said they followed proper procedures. 

"I’m confident he was more than unconscious at that point," he said. "Involuntary movement is not uncommon. That’s how I would characterize it."

In this undated photo released by the Montgomery (Ala.) Police, police officer Anderson Gordon poses for an official photograph. Gordon was killed in 1997 when he was shot by Torrey Twane McNabb fleeing a bail bondsman.

Gordon's family thanked the attorney general's office, the Montgomery Police Department, former Montgomery County District Attorney Ellen Brooks, current Montgomery District Attorney Daryl Bailey and Sarah Green of Victim's Services.

"Over 20 years ago, we lost a companion, a father, a brother, and a friend who only wanted to make a difference in his community," the family said in a statement. "'Brother,' as he was affectionately called, worked to make a difference in his community until his life was taken on Sept. 24, 1997." 

McNabb, then 20, was fleeing a bail bondsman when he got into the accident that night. When Gordon pulled up to respond, McNabb approached his patrol car and fired at least four times at Gordon. The police officer, the father of a toddler, was pronounced dead at the scene.

On Friday, Brooks, who prosecuted McNabb, called it “a senseless, needless crime.”

“In a sense, (Gordon) was an innocent bystander,” she said. “It was so senseless.”

At his trial, McNabb said he had ingested a large amount of cocaine that day and “panicked” when he saw Gordon come up. He apologized to Gordon’s family from the witness stand and said, “I know I have caused them a lot of hurt.”

“I absolutely believe he was remorseful,” said Rhonda Brownstein, legal director of the Southern Poverty Law Center who was part of McNabb’s legal team in 1999. 

The Gordon family statement said that while "the wounds of having a family member murdered can never be healed," they were "strong, and will continue to be resilient."

"Though this has been a difficult day for the Gordon family, we would also like to pray for the family of Torrey McNabb," the statement said.

McNabb refused his breakfast Wednesday and did not ask for a final meal. The inmate also asked that the prison chaplain not enter the death chamber with him; a chaplain was present but did not pray with McNabb. Alabama Department of Corrections spokesman Bob Horton said McNabb did not want "anything of a religious nature performed before or during his execution."

Staff conducted two consciousness tests on McNabb during the execution, one more than is common. A correctional officer in the room calls out the condemned inmate's name, opens one of his eyes and pinches his arm. Dunn did not say if there were any changes to the administration of drugs, but said the two consciousness checks were meant to "err on the side of caution."

The case got caught up in a legal fight over Alabama’s method of lethal injection. Officials first inject an inmate with midazolam, a sedative designed to render a person unconscious. After a consciousness check, the inmate is injected with rocuronium bromide, which paralyzes the muscles, and potassium chloride, which stops the heart.

Alabama has used the protocol in four executions conducted in the last 22 months. Three took place without visible incident. But Ronald Bert Smith, executed in December, gasped and coughed for 13 of the 34 minutes of his execution. Critics say midazolam cannot maintain unconsciousness in the face of a stressful event, such as one’s execution.

Earlier in the evening, the U.S. Supreme Court Thursday lifted a stay of execution against McNabb that had arisen amid questions about a pending lawsuit challenging the state's method of putting inmates to death. Justice Clarence Thomas wrote that the lower court failed to find that McNabb was likely to succeed in his challenge.

Contributing: The Associated Press. Follow Brian Lyman on Twitter: @lyman_brian