The US Supreme Court has ruled that a controversial drug used by one state as part of its lethal injection procedure does not violate a constitutional ban on cruel and unusual punishment, dealing a setback to opponents of the death penalty.

In a 5-4 vote, with its conservative justices in the majority, the court handed a loss to three inmates who objected to the use of a sedative called midazolam, saying it cannot achieve the level of unconsciousness required for surgery, making it unsuitable for executions.

Justice Samuel Alito wrote on Monday on behalf of the court that the inmates had, among other things, failed to show that there was an alternative method of execution available that would be less painful.

In a dissenting opinion, liberal Justice Stephen Breyer said the court should consider whether the death penalty itself is constitutional. He was joined by one of his colleagues, Justice Ruth Bader Ginsburg.

The three-drug process used by Oklahoma prison officials has been under scrutiny since the April 2014 botched execution of convicted murderer Clayton Lockett.

He could be seen twisting on the gurney after death chamber staff failed to place the intravenous line properly.

Inmates Richard Glossip, John Grant and Benjamin Cole challenged the procedure. Glossip arranged for his employer to be beaten to death. Grant stabbed a correctional worker to death. Cole killed his nine-month-old daughter.

'Cruel and unusual punishment'

The main question before the nine justices was whether the use of midazolam violates the constitution's Eighth Amendment prohibition on cruel and unusual punishment.

"I believe it highly likely that the death penalty violates the Eighth Amendment," Breyer wrote.

Justice Antonin Scalia responded to Breyer in a separate concurring opinion. Scalia said Breyer's arguments were full of "internal contradictions" and were "gobbledy-gook."

The case did not address the constitutionality of the death penalty in general, but it brought fresh attention to the ongoing debate over whether the death penalty should continue at a time when most developed countries have abandoned it.

During the oral argument in April, Alito, who is considered a conservative, said the challenge to the drug was part of a "guerrilla war" against the death penalty.

On the other side, liberal Justice Elena Kagan contended that the way states carry out most executions amounts to having prisoners "burned alive from the inside".

Lawyers for the inmates argued that midazolam is not approved for use in painful surgeries and should not be used in the death chamber because it cannot maintain a coma-like unconsciousness, potentially leaving inmates in intense pain from lethal injection drugs that halt breathing and stop the heart.

The drug has been used in executions in the states of Oklahoma, Florida, Ohio and Arizona.

The Supreme Court in 1976, in a case called Gregg versus Georgia, reinstated the death penalty in the US.

Thirty-one of the 50 states have the death penalty.

Source: Agencies