OKLAHOMA CITY — A longtime lawyer for Oklahoma's prison system said Thursday that he felt pressured by the governor's and attorney general's offices to make sure two executions last spring happened on schedule, even though the state didn't have the drugs to carry them out.

With access drying up to its usual cache of lethal drugs because of manufacturers' opposition to the death penalty, retired Department of Corrections general counsel Michael Oakley talked to counterparts in other states and conducted his own online research before settling on midazolam, a sedative the state had never used before.

"There was pressure from people above us to get it done," Oakley told a federal judge who is considering whether death row inmates have a valid complaint that the state is essentially experimenting on them by using untested drugs or drug combinations during executions.

The lawsuit follows the April execution of Clayton Lockett, who writhed on the gurney, mumbled and tried to lift his head after the lethal drugs were injected directly into his tissue instead of his blood because of problems with an intravenous line.

Before the execution, Oklahoma adopted a new protocol that included midazolam, along with two others designed to stop his breathing and his heart. The 43-minute execution prompted the state to impose a moratorium, which is set to end Jan. 15.

Lockett's execution was initially scheduled for March 20, but the state postponed because it didn't have enough drugs on hand.

In testimony Thursday before U.S. District Judge Stephen Friot, Oakley said he received word from Attorney General Scott Pruitt's office "to go ahead and do something."

Midazolam, a sedative commonly used before surgery, had been used successfully at a much higher dose in Florida, but during a January execution in Ohio, an inmate made gasp-like sounds for several minutes before dying. The drug also was used in a lengthy Arizona execution in July.

Lockett and Charles Warner's execution were each set for April 29, but Gov. Mary Fallin issued a stay for Warner's after the trouble during Lockett's death. Warner is scheduled to die Jan. 15, then three more executions are scheduled through March 5.

Prison officials have said new protocols adopted after Lockett's death, new medical supplies and extensive new training for the execution team will ensure future executions go smoothly. Oklahoma State Penitentiary Warden Anita Trammell said she and prison staff spend nearly an entire day each week conducting drills and preparing for possible problems.

The new execution protocol still calls for using midazolam, but at the higher dose that has been used in Florida.

Larry Sasich, a doctor of pharmacy and an expert on drug efficacy, testified midazolam is a poor choice for executions because the drug can sometimes cause a paradoxical reaction, where a person becomes agitated and combative instead of sedated. He said Lockett likely sensed suffocation from the paralytic vecuronium bromide and excruciating pain from the third drug, potassium chloride.

"He was definitely experiencing pain, and I believe suffering," Sasich said.

A state investigation of Lockett's lethal injection said a faulty intravenous line was primarily responsible for the problematic execution. Capt. Jason Holt, who led the probe, said there was no inquiry into the properties of the drugs used and no recommendation about using midazolam.

Testimony is scheduled to resume in the case on Friday, and Friot is expected to rule early next week.

Lockett was convicted of shooting Stephanie Nieman, 19, with a sawed-off shotgun and watching as two accomplices buried her alive in 1999.