The “death chamber” in Huntsville, Tex. (Paul Buck/AFP/Getty Images)

The Supreme Court’s announcement Friday that it would consider lethal injection, potentially reshaping the way executions are carried out in the United States, comes just a week after the justices declined to stop an execution in Oklahoma. But it also comes after several erratic years of executions around the country, as states have changed their protocols again and again, scrambled to obtain the necessary drugs and faced criticism for effectively experimenting with capital punishment.

And, pivotally, the Supreme Court’s action comes after a year with three high-profile, problematic executions. All three executions drew an unusually large amount of attention to the problems facing lethal injection in this country, and all three executions involved the sedative midazolam.

The justices said they would take up a case presented by three inmates currently scheduled to be executed by Oklahoma over the next six weeks, with the first of these executions planned for next Thursday. (Attorneys say they will file stay requests for the three inmates.) The court had originally been petitioned by four inmates, rather than three, but Charles Warner, the fourth inmate, was put to death in Oklahoma last week after the justices declined to stay the execution.

Warner, who was convicted of raping and murdering an 11-month-old, was the first inmate executed in Oklahoma since the state botched the lethal injection of Clayton Lockett last year. Attorneys for Warner and the other three inmates had asked the court to stay the executions, arguing against the use of midazolam. Since only the court’s four liberal justices said they would have granted the stay, Warner’s execution was carried out under a new lethal injection policy Oklahoma initiated last fall.

This new policy still utilizes midazolam, which was also used in Lockett’s bungled execution, but it calls for five times the dose that was supposed to be injected into Lockett. That dosage is the same that Florida has used in 11 executions since 2013, according to the Death Penalty Information Center, most recently when the state executed an inmate the same night Warner was put to death. (Johnny Kormondy, who was convicted of killing a banker and raping his wife in 1993, was executed at the Florida State Prison in Starke.)

The drug midazolam has become a key part of the debate over how the country executes inmates, and issues with executions using the drug appear to be why the justices are taking up the issue. But it represents a larger problem facing states with lethal injection: The drugs they used to utilize simply aren’t available anymore. To understand how we got to the Supreme Court considering the issue, you have to rewind a few years to understand why midazolam was being used in the first place.

Lethal injection is the primary method of execution in the United States, but in recent years states have had trouble getting the necessary drugs, largely because European companies and officials have protested the use of drugs supplied by European companies in American executions.

Until 2010, most lethal injections were carried out using a three-drug combination: an anesthetic, a paralytic drug and a drug that stopped the heart. The drug sodium thiopental was commonly used as an anesthetic, cropping up in nearly every execution carried out in 2009 and 2010. But in 2011, Hospira, which manufactured the drug, announced that it would “exit the sodium thiopental market” because the Illinois-based company couldn’t guarantee it would no longer be used for lethal injections. (The company was going to produce more of the drug at a plant in Italy, but Italian officials would not allow the export of the drug if it was going to be used for capital punishment.)

So states switched to using pentobarbital, which has been used extensively since 2011. But Lundbeck, the Danish company that supplied the drug, was unhappy it was going to be used for executions and said it would no longer ship it to prisons in states with lethal injection.

That is when states began to scramble, according to death penalty experts. The states that ran out of pentobarbital had to figure out what else they could use, and others were turned down in their attempts to obtain drugs. And a handful of states considered returning to the firing squad or gas chamber to avoid needing lethal injection drugs at all.

Some states turned to midazolam because of this drug shortage. The sedative has been used by four states since 2013, and three of the states have had problems. When Oklahoma executed Lockett last year, he kicked his legs and grimaced before dying 43 minutes after the lethal injection began. A state investigation later found problems with the way the execution team inserted the needle and conducted the lethal injection.

Ohio had used the drug months earlier, and the inmate in that execution gasped and choked before taking about 25 minutes to die. An Arizona inmate took nearly two hours to die last summer, gasping and snorting before he died. Florida, the first state to use the drug for an execution, has utilized it repeatedly and without witnesses seeing these kinds of issues occur. (A media witness did say that when the state first used the drug, the inmate being executed seemed to remain awake longer and continue to move for longer than other people had during their executions.)

All of which brings us back to Oklahoma last week. Warner was executed using the increased dosage of midazolam that Oklahoma announced it would use after Lockett’s death; his attorneys had said his execution should be delayed again because of the drug’s involvement. Warner’s execution had initially been scheduled the same night as Lockett’s, but his lethal injection — set for two hours after Lockett’s — was postponed and ultimately pushed into 2015.

The court’s four justices who said the execution should be stayed were overruled by the other five justices. In her dissent, Justice Sonioa Sotomayor said that while she agrees that the four inmates asking for stays should be punished for their crimes, “the Eighth Amendment guarantees that no one should be subjected to an execution that causes searing, unnecessary pain before death.”

Sotomayor’s dissent appeared to foreshadow the possibility that the court would act on the issue. While five justices would have been needed to stay the execution last week,  it only takes four of the justices to accept a case.

She went on to question a lower court’s thought that midazolam would “work as intended difficult to accept given recent experience with the use of this drug.” Since a paralytic is also injected as part of the lethal injection, that “may mask the ineffectiveness of midazolam as an anesthetic,” because an inmate could be conscious but unable to move, she wrote.

This fact has been cited by opponents of the drug before, and experts have said that it is unclear whether the drug could produce a deep enough level of unconsciousness to prevent an inmate from feeling pain from the injections that follow.

“The questions before us are especially important now, given states’ increasing reliance on new and scientifically untested methods of execution,” Sotomayor wrote in her dissent.

The court considered the issue of lethal injections relatively recently, ruling in the Baze v. Rees case in 2008 that they would uphold Kentucky’s lethal injection protocol. (This effectively dissolved a moratorium on executions in the country.) But the situation facing the court now and the state of capital punishment is drastically different, said Deborah W. Denno, a Fordham University professor and expert on the death penalty who has been critical of the way lethal injection has been utilized.

“It’s about time that the Supreme Court took a lethal injection case, and on this issue in particular,” Denno said in a telephone interview Friday night.

Since the court’s action in 2008, the drug shortage has caused states to veer wildly away from the protocol the justices said did not violate the Constitution’s ban on cruel and unusual punishment. Chief Justice John G. Roberts Jr. wrote at the time that a state using “a lethal injection protocol substantially similar to the protocol we uphold today would not create a risk” that would be unconstitutional. Yet the protocols have shifted broadly since then, moving states away from the three-drug combination used by Kentucky, as some have switched to different three-drug combinations or carried out executions with one or two drugs.

“It’s been protocol changes on crack ever since then, to an unprecedented degree,” Denno said. “We’ve had many kinds of execution method and protocols. Even though they’re all lethal injections, they’re all different kinds of executions. We’ve never had anything like this in the history of this country, in the history of the death penalty.” ​

Similarly, attorneys for the Oklahoma inmates said Friday that “the lethal injection landscape” had changed since 2008.

“The time is right for the court to take a careful look at this important issue, particularly given the bungled executions that have occurred since states started using these novel and experimental drugs protocols,” Dale Baich, one of the attorneys representing the Oklahoma inmates, said in a statement.

As the issue heads to the Supreme Court, it is worth noting that for many states, this topic has simply become less of a consideration. The attention focused on the bungled executions last year and the court’s consideration now may overshadow the fact that the death penalty is on the decline. The United States executed 35 inmates last year, the lowest number in two decade. Fewer states are carrying out executions and fewer inmates are sentenced to death.

Meanwhile, while support for the death penalty may have fallen since the 1990s, a majority of the American public still supports the practice, a number that did not change after last year’s highly publicized problems.

The justices are expected to hear the case in April. But there is “no question” that the court’s decision could drastically alter the way lethal injections are carried out in this country, Denno said. After years of pivots and changes, uncertainty and drug substitutions, the justices could provide some measure of clarity for a process that has become fractured and inconsistent.

Robert Barnes contributed to this report.

RELATED: Everything you need to know about executions in the United States.