(CNN) -- A federal court has granted a stay of execution for white supremacist serial killer Joseph Paul Franklin, hours before he was scheduled to die by lethal injection in Missouri.
Franklin is on death row for the 1977 murder of Gerald Gordon outside a synagogue in St. Louis. He's been blamed for a total of 22 killings between 1977 and 1980 in a bid to start a race war.
He is challenging Missouri's decision to use the drug pentobarbital in its lethal injection protocol, arguing it would violate the Constitution's ban on cruel and unusual punishment.
U.S. District Judge Nanette Laughrey granted a stay on Tuesday, finding Franklin's lawyers showed the use of pentobarbital carried "a high risk of contamination and prolonged, unnecessary pain beyond that which is required to achieve death."
"Given the irreversible nature of the death penalty and plaintiffs' medical evidence and allegations, a stay is necessary to ensure that the defendants' last act against Franklin is not permanent, irremediable cruel and unusual punishment in violation of the Eighth Amendment," Laughrey wrote.
Another federal judge granted a second stay Tuesday, based on a separate defense petition contesting Franklin's competency.
"The Court concludes that a stay of execution is required to permit a meaningful review," U.S. District Judge Carol Jackson wrote.
The state is appealing both stays to the 8th U.S. Circuit Court of Appeals.
Defense attorney Jennifer Herndon said that she expects that court will rule within the next day.
The execution warrant window is 24 hours, meaning that if the court rules against the stays, Franklin could still be put to death on Wednesday.
"We're hoping the stays stay in place," Herndon said, adding that she would be surprised if both were vacated.
Franklin had been scheduled to be put to death shortly after 12 a.m. Wednesday (1 a.m. ET) at the state prison in Bonne Terre, Missouri, about 60 miles south of St. Louis. But Missouri and other states that conduct executions have had to scramble for new drugs after European-based manufacturers banned American prisons from using their drugs in executions.
Missouri had planned to use propofol, the surgical anaesthetic made infamous by the death of pop star Michael Jackson. But Gov. Jay Nixon reversed that decision after being warned the European Union -- whose members forbid capital punishment -- might halt shipments of the drug, leading to shortages for medical purposes.
In October, the state announced it would use pentobarbital, which would be provided by an unnamed compounding pharmacy. Franklin's lawyers argued that would raise the risk of contamination and a painful death.
Nixon denied clemency for Franklin on Monday, arguing Franklin had committed "merciless acts of violence, fueled by hate."
In addition to the killings, Franklin admitted to the attempted assassinations of Hustler magazine publisher Larry Flynt in 1978 and civil rights leader Vernon Jordan in 1980. Flynt, who was paralyzed by Franklin's bullet, has called for clemency for Franklin, saying "the government has no business at all being in the business of killing people."
CNN's Dana Ford contributed to this report.