In recent years, as pharmaceutical companies have halted sales of drugs used in executions, as legal challenges have mounted and medical groups have vowed to ostracize doctors who participate in sanctioned killings, states have found themselves winging it when it comes to carrying out lethal injections.

Some states, like Oklahoma, have relied on unproven drug cocktails, all while saying they must conceal the source of the drugs involved to protect suppliers from legal action and harassment.

"It looks like a street-level drug deal," said Dean Sanderford, a lawyer for Lockett. "And they're keeping all the information secret from us. . . . They don't need to be carrying out any more executions until they come clean, until we know exactly what happened with Clayton's execution and everything about these drugs, where they're getting them."

This new era in death row improvisation has produced sometimes disturbing results, even before the debacle in Oklahoma, in which Lockett thrashed on a gurney before dying from an apparent heart attack after 43 minutes. Oklahoma's corrections director said the vein line meant to administer lethal drugs into Lockett's body had "exploded" and that the drugs were not having the intended effect.

According to the nonprofit Death Penalty Information Center, 32 states and the federal government have the death penalty, and all use injection as their primary method of execution. Until 2010, most states still using lethal injection relied on a fairly standard three-drug protocol. The combination typically included an anesthetic such as sodium thiopental or pentobarbital, a paralyzing agent such as pancuronium bromide and a drug such as potassium chloride to stop the heart.

But events in recent years undermined that approach and left many states wrestling with moral and practical questions of how to carry out death sentences without violating the Constitution's ban on "cruel and unusual" punishment.

In the spring of 2010, the American Board of Anesthesiologists decided to revoke the certification of any member who participated in a lethal injection, a move that could prevent an anesthesiologist from working in most hospitals.

Soon came a shortage of a critical drug used in most lethal injections. The sole U.S. company providing sodium thiopental announced in 2011 that it would stop selling the powerful anesthetic, citing objections from Italy, where the drug had been manufactured. State corrections officials sought to import the drug, but the European Union banned the export of drugs used in executions, and U.S. officials seized some drugs at the border.

Many states, including Ohio and Oklahoma, switched primarily to another anesthetic drug, pentobarbital, which is used mostly for inducing comas in patients in cases of brain injury and is also used by veterinarians to anesthetize or euthanize animals. After a Danish manufacturer restricted its use in executions, some states sought out the drug from compounding pharmacies, which custom-mix small batches of drugs and whose products until recently have not been regulated by the Food and Drug Administration.

When supplies of pentobarbital began to run short, states turned to another more widely available drug, midazolam, which is often used to sedate surgery patients before they receive anesthesia, and which Oklahoma used for the first time in its lethal injection protocol on Tuesday.

In October, Florida became the first state to put midazolam to the test on death row, despite worries from some experts that the drug might not produce a deep enough level of unconsciousness to prevent an inmate from feeling the pain that comes from the injections that follow.

Indeed, the Associated Press reported that convicted murderer and rapist William Happ "remained conscious longer and made more body movements after losing consciousness than other people executed recently by lethal injection under the old formula."

Court challenges followed from other Florida death row inmates, just as they have in a number of other states.

In January, midazolam was again in the spotlight. Ohio's supply of pentobarbital expired and the state became the first to try midazolam as part of a two-drug injection cocktail, with the painkiller hydromorphone. Dennis McGuire, convicted of raping and murdering a 22-year-old pregnant woman, spent roughly 10 minutes alternately snorting and gasping for air after receiving the drug. His execution lasted almost half an hour — the longest since Ohio had resumed the death penalty in 1999.

A state investigation concluded that there was no evidence that McGuire "experienced any pain, distress or anxiety." Officials insisted that the execution had been carried out in a humane and constitutional way and that McGuire felt no pain, despite the eyewitness accounts of his writhing on the table.

Even so, the state announced that when it carries out its next execution, it would use five times the dosage of the midazolam and also would increase the amount of hydromorphone.

Oklahoma Gov. Mary Fallin announced Wednesday that she has ordered an independent review of the state's execution procedures.

She also said an independent pathologist will determine the precise cause of death for Lockett, who had shot a 19-year-old woman and ordered accomplices to bury her alive. Fallin issued a two-week stay of Charles Warner's execution, which had been scheduled to occur after Lockett's on Tuesday night. Warner was convicted of raping and murdering his girlfriend's 11-month-old baby.

Greece's parliament voted early Thursday following a marathon 20-hour session to investigate 10 senior politicians, including two former prime ministers, over allegations they were involved in a pharmaceutical bribery scandal