Use in executions
The drug has been introduced for use in executions by lethal injection in certain jurisdictions in the United States in combination with other drugs. It was introduced to replace pentobarbital after the latters manufacturer disallowed that drugs use for executions. Midazolam acts as a sedative but will fail to render the condemned prisoner unconscious, at which time vecuronium bromide and potassium chloride are administered, stopping the prisoners breathing and heart, respectively. Since the condemned prisoner is not unconscious but merely sedated, two very different things, those following two drugs can cause extreme pain and panic in the soon to die prisoner.Midazolam has been used as part of a three-drug cocktail, with vecuronium bromide and potassium chloride in Florida and Oklahoma prisons. Midazolam has also been used along with hydromorphone in a two-drug protocol in Ohio and Arizona.The usage of midazolam in executions became controversial after condemned inmate Clayton Lockett apparently regained consciousness and started speaking midway through his 2014  execution when the state of Oklahoma attempted to execute him with an untested three-drug lethal injection combination using 100 mg of midazolam. Prison officials reportedly discussed taking him to a hospital before he was pronounced dead of a heart attack 40 minutes after the execution began. An observing doctor stated that Locketts vein had ruptured.
He died without incident in about 14 minutes on 13 September 2017.On 24 April 2017, the state of Arkansas carried out a double-execution of Jack Harold Jones, 52, and Marcel Williams, 46. The state of Arkansas attempted to execute eight people before its supply of midazolam expired on 30 April 2017. Two of them were granted a stay of execution, and another, Ledell T. Lee, 51, was executed on 20 April 2017.On 28 October 2021, the state of Oklahoma executed inmate John Marion Grant, 60, using midazolam as part of its three-drug cocktail hours after the U.S. Supreme Court ruled to lift a stay of execution for Oklahoma death row inmates. The execution was the states first since 2015. Witnesses to the execution said that when the first drug, midazolam, began to flow at 4:09 p.m., Grant started convulsing about two dozen times and vomited. Grant continued breathing, and a member of the execution team wiped the vomit off his face. At 4:15 p.m., officials said Grant was unconscious, and he was pronounced dead at 4:21 p.m.

Legal challenges
In Glossip v. Gross, attorneys for three Oklahoma inmates argued that midazolam could not achieve the level of unconsciousness required for surgery, meaning severe pain and suffering was likely. They argued that midazolam was cruel and unusual punishment and thus contrary to the Eighth Amendment to the United States Constitution.