In the second execution in Alabama in two weeks, the state put to death Robert Bryant Melson, 46, for killing three people during a robbery at a Popeye's restaurant in Gadsden, 60 miles northeast of Birmingham, Alabama. Officials said Melson was pronounced dead at 11:27 p.m. EDT Thursday following a lethal injection for the murders committed in 1994.

Melson's attorneys had filed last-minute appeals seeking to stay the execution as they argued the state planned to use an ineffective drug (midazolam) that would not “reliably” render Melson unconscious at the start of the execution procedure. They cited another execution carried out in December in which an Alabama man who had been administered the sedative, coughed and heaved for about 13 minutes before dying, which they said showed “undue suffering.” They also said use of midazolam violated the constitutional protections against cruel and unusual punishment, a local publication WHNT19 News reported.

Last week, a federal appeals court in Atlanta had issued a stay of execution of Melson because of the drug’s use. However, Alabama appealed to the Supreme Court, which lifted the stay Tuesday, allowing Melson’s execution to proceed Thursday, reports said.

Read: Tennessee Upholds The State’s Lethal Injection Executions

The debate over using midazolam in executions has been going on for a long time, with death penalty opponents saying the sedative doesn't put inmates into a deep state of unconsciousness before more painful chemicals are administered.

The valium-like drug has been used in executions in Ohio, Oklahoma, and Arizona that took longer than usual or were botched. In several instances, witnesses said they saw convicted murderers twisting on gurneys before dying, Reuters reported.

In December, 45-year old Ronald Smith was also administered midazolam during his execution in Alabama. During the 34-minute execution, Smith heaved and coughed for about 13 minutes and underwent two consciousness tests to make sure he couldn't feel pain. He was also seen moving his lips after the drugs were administered in the execution, according to a reporter from who witnessed the execution.

Experts point to the unbearable pain when a convict is executed after administering midazolam. "It shows there is a clear and ongoing risk that prisoners who are executed in a multi-drug protocol using midazolam are going to be exposed to searing pain during the course of the execution," Reuters reported, citing Robert Dunham, executive director of the non-profit Death Penalty Information Center, which examines issues regarding U.S. capital punishment.

ReadArkansas To Execute 8 Men In 10 Days, After 12 Year Hiatus On Executions

An attorney for an Arkansas inmate executed in April – the fourth in eight days – called the execution "horrifying." An Associated Press reporter who witnessed the execution said the body of the convict, Kenneth Williams, twitch 15 times in quick succession.

But J.R. Davis, a spokesman for Gov. Asa Hutchinson referred to the twitching as “an involuntary muscular reaction” that he said, was a widely known effect of the midazolam.

Death penalty opponents continue to debate over effectiveness of midazolam in convicts.