Clayton Lockett, pictured in June 2011. (Oklahoma Department of Corrections via Associated Press)

The botched execution of Clayton Lockett in Oklahoma disturbed witnesses and stirred the nation: A convicted murderer, deemed unconscious, began twitching and convulsing on the gurney, only able to raise his head.

After 43 minutes of apparent anguish, the man died of a heart attack. Lockett’s bungled execution led Oklahoma to reconsider its lethal-injection protocols, and spurred Lockett’s brother to file suit — alleging torture and human medical experimentation, among other claims.

In a decision filed Tuesday, a federal appeals court upheld the 2015 decision to dismiss the lawsuit, ruling that the lethal-injection process did not qualify as cruel and inhumane. What took place during the execution, a three-judge panel of the U.S. Court of Appeals for the 10th Circuit held, was a sort of “’innocent misadventure’” or “’isolated mishap.’”

The judges acknowledged that Lockett suffered during the procedure. But citing previous Supreme Court death-penalty opinions, Judge Gregory A. Phillips, writing for the court, stated that simply “’because an execution method may result in pain, either by accident or as an inescapable consequence of death, does not establish the sort of objectively intolerable risk of harm that qualifies as cruel and unusual.’”

Lockett’s death led to a moratorium on executions in Oklahoma and drew scrutiny from President Obama and the United Nations. A state investigation later found a slew of problems with the execution team’s training, and concluded that executioners did not properly monitor the IV. Oklahoma’s execution protocols were rewritten after Lockett’s death to include more training and better equipment for the execution team.

Before Lockett’s death, Oklahoma had not used midazolam during an execution. Executioners gave Lockett the drug to render him unconscious before giving him two other drugs to carry out the death.

Tuesday’s appellate ruling argued that although the complaint took issue with the three-drug protocol and the midazolam quantity used in the injection, “everyone agrees” that the suffering was caused by the IV.

“The drugs leaked into the surrounding tissue rather than into his bloodstream, keeping Lockett from receiving full doses of the drugs,” the ruling stated. Since the first drug did not knock him unconscious, the second and third drugs likely asphyxiated him and caused burning and intense pain until he died from cardiac arrest.

Because Lockett’s groin — where the IV had been inserted — was covered, the execution team did not notice the IV failures until several minutes after the execution process began, Mark Berman reported in The Washington Post.

The appellate judges recognized that Lockett’s execution probably would have gone “smoother” if Oklahoma had required a backup IV line and an unobstructed view of the IV site by the medical staff.

However, these deficiencies did not amount to the “deliberate indifference” alleged in Lockett’s complaint, the judges wrote.

In his lawsuit, Lockett’s brother, Gary Lockett, sued Gov. Mary Fallin (R), other state officials and a doctor, claiming that the “barbaric” execution violated his brother’s constitutional right to be free from cruel and unusual punishment.

In 2015, U.S. District Judge Joe Heaton dismissed the lawsuit, which Gary Lockett appealed. Upholding Heaton’s decision in a 3-0 ruling, the panel wrote that public officials are protected from such lawsuits under a qualified immunity, “so long as their conduct does not violate clearly established statutory or constitutional rights of which a reasonable person would have known.”

Lockett was sentenced to death in 2000. He had been convicted of murder and a slew of other charges after he and his accomplices sexually assaulted two teenage women. Lockett shot one of the women twice before she was buried alive, witnesses said.

Lockett was the 111th person killed in Oklahoma by lethal injection. Those who witnessed the execution described feeling shocked and shaken by the inmate’s apparent agony, Berman wrote. One of Lockett’s attorneys called it “the most awful thing I’ve ever seen.”

In previous Oklahoma executions, doctors had pronounced each prisoner dead after six to 12 minutes. It took 43 minutes for Lockett to die.

Three minutes after Lockett was pronounced unconscious, witnesses saw his foot kick, his jaw clench and his head roll as he appeared to try to get up. As he lifted his head, observers could only make out a few of his final words.

“Oh, man,” he muttered.

More from Morning Mix: 

Ala. man sentenced for murdering daughter’s sexual abuser 13 years after his prison release. Thousands support him.

China tells Trump climate change is not a Chinese hoax

Man who dissolved in boiling Yellowstone hot spring slipped while checking temperature to take bath