Alabama cruelly and excessively violated the bounds of human decency last night when it knowingly inflicted torturous pain during Ronald Smith’s botched execution.

And it should never have come to this.

Ronald Smith’s jury had voted to spare his life, but the trial judge in the case overrode the jury’s verdict and sentenced him to death under Alabama’s outlier practice. A divided Supreme Court then denied Smith’s request to postpone his execution to review the issue of judicial override, and Alabama moved forward with his execution.

The execution of Ronald Smith last night took far longer than it should have, 34 minutes, during which time his body heaved as he struggled. He was almost certainly awake when the prison administered the agonizing drugs, whose administration without sedation is an open and shut violation of the Eighth Amendment’s prohibition on cruel and unusual punishment.

Alabama had insisted on using midazolam, a failed drug that has no place in executions. It did this despite the dire and clear warnings from previous botched executions in virtually every state that has tried it: Arizona, Florida, Oklahoma, and Ohio. Worse still, Alabama moved forward with the administration of excruciating drugs after it became clear that the midazolam failed to sedate Smith.

Midazolam is supposed to make inmates lose consciousness so that they will not feel the effects of the undeniably torturous drugs that follow it. But physicians have repeatedly explained that midazolam is not up to the task of preventing inmates from regaining consciousness. The growing list of botched executions using midazolam is entirely too predictable: Dennis McGuire in Ohio, Joseph Wood in Arizona, and Clayton Locket in Oklahoma. All moved and struggled after administration of midazolam.

After McGuire was reported unconscious by the prison, he clenched his fist. Then for 25 minutes, his body heaved, and he struggled, gasped, choked, and snorted. Lockett’s vein had blown during his execution, and he writhed, clenched his teeth, and mumbled. Wood’s execution took almost two hours, during which he was choking, snorting, and gasping for air, much like McGuire.

Ronald Smith’s execution is the latest in this chain of unconscionable failures. According to witnesses, Smith heaved, struggled for breath, coughed, and talked after the administration of midazolam. He failed both consciousness checks: He heaved, gasped, and coughed after the first one. He moved his arm and hand after the second. The entire purpose of a consciousness check is to have some assurance that the inmate is no longer responsive and will not feel the terrifying pain accompanying the second and third drugs in the protocol.

Here, Smith failed the checks, and the prison moved forward anyway. It appears that the state of Alabama intentionally inflicted torturous pain on Smith, knowing that the midazolam had failed. The warden conceded later that the prison had no contingency plan in place in case the midazolam wasn’t working and that it had just followed the only protocol it had.

How could this happen?

Much of the explanation lies with the abdication of the courts. Smith’s lawyers had challenged the use of midazolam and warned that the prison needed a plan for how to respond if the midazolam failed. Their challenges were denied without any court’s oversight because in Alabama, like other places, the lower courts have adopted an impossible test for challenging lethal injection methods. In order for a court to even consider the claim, the inmate must suggest an alternative method for their own execution.

Making a death row inmate propose the method of execution, the product of the Supreme Court’s controversial decision in Glossip v. Oklahoma, is itself wrong and today we’ve seen its disastrous result. And the lower courts have made this requirement worse by demanding that inmates point to an alternative that exists in state law. Smith asked for death by firing squad, believing it would be less painful than the midazolam protocol. The courts said that alternative was not good enough because Alabama law didn’t provide for it. Under this logic, if Alabama announced it planned to execute people by burning them at the stake and didn’t provide for another method, no death row inmate could ever get into court to challenge the stake burning.

The legal morass surrounding lethal injection is untenable, and it must be addressed by the courts. Our legal system must provide for some mechanism of judicial review of torturous and failed drug options. Most immediately, Alabama should order a full investigation of Ronald Smith’s botched execution and halt further executions until it has an appropriate protocol. Alabama as well as Virginia and Arkansas, two other states that threaten to use midazolam in upcoming executions, should reject the use of the drug now.

The Constitution and human decency demand no less.