Ricky Gray is escorted from the county courthouse in Culpeper, Va., ins 2007. Gray is scheduled to be executed for the 2006 murders of the Harvey family of Richmond. (Mike Morones/AP)

If death row inmate Ricky Gray is executed in Virginia on Wednesday evening, he will be injected with a controversial drug obtained as part of a process shrouded in secrecy.

Virginia’s Department of Corrections has never used midazolam, which has been involved in several prolonged and apparently painful executions in other states. Virginia procured the drug from a compounding pharmacy whose name is shielded from the public.

Attorneys for Gray, who murdered a well-loved Richmond couple and their young daughters in 2006, filed an emergency application for a stay of execution Tuesday with the U.S. Supreme Court, after Gov. Terry McAuliffe (D) declined to commute his sentence.

“It is the Governor’s responsibility to ensure that the laws of the Commonwealth are properly carried out unless circumstances merit a stay or commutation of the sentence,” said a statement from McAuliffe, who is opposed to the death penalty but has promised to uphold the state’s capital punishment law. “After extensive review and deliberation, I have found no such circumstances.”

McAuliffe’s refusal came after the U.S. Court of Appeals for the 4th Circuitdeclined last week to halt the execution.

“Ricky’s execution will serve no purpose other than retribution,” Gray’s attorneys, Jon Sheldon and Rob Lee, said in a statement after McAuliffe announced his decision. “We regret that he will no longer be able to try to make amends for his past wrongs.”

The execution of Gray, 39, would be the first since October 2015 and the first to take place since the state passed a law to keep secret the identities of pharmacies that produce the lethal drugs, as a way to protect them from political pressure.

Gray has admitted that, with help from his nephew Ray Dandridge, he beat his wife to death with a lead pipe and dumped her body on a hill in Washington, Pa. in October 2005. Three months later, on New Year’s Eve, they attacked Ryan Carey as he walked from his car to his parents’ home in Arlington, stabbing him multiple times, according to Gray’s confession. Carey ran into the home and survived, but he permanently lost the use of his right arm.

The next day, as the Harvey family in Richmond prepared for its New Year’s Day party, Gray and Dandridge entered their home through an unlocked door. They brought Kathryn, Bryan, 9-year-old Stella and 4-year-old Ruby to the basement, tied them up and taped their mouths closed. After ransacking the house, Gray cut every family member’s throat. He bludgeoned them with claw hammers. Then he poured two bottles of wine over an easel and lit a match, setting the basement on fire. The men left with some electronics, a wedding ring and a plate of homemade cookies.

The scene was so awful that when homicide detectives arrived, they cried.

Gray and Dandridge say 21-year-old Ashley Baskerville helped them target the Harveys and hide after the murders. A week later, they planned to attack Baskerville’s mother and stepfather. They were bound, stabbed, then gagged and suffocated in their home. So was Baskerville, who Gray reportedly complained was nagging him for money.

Advocates against the death penalty argue that Gray’s crimes are irrelevant to the concerns regarding midazolam, a drug normally prescribed for anxiety and minor surgery.

“One of the hallmarks of constitutional safeguards is that they exist to protect everybody,” said Robert Dunham, executive director of the Death Penalty Information Center. “One does not get to torture somebody because you don’t like what they’ve been convicted of doing.”

In five out of 19 executions in which midazolam has been used since its introduction in 2014, according to statistics compiled by the Death Penalty Information Center, the condemned person has shown signs of pain or difficulty breathing and has taken longer to die than expected.

Although use of the drug in executions was narrowly upheld by the Supreme Court, the pharmacologist who testified in favor of its use relied heavily on the consumer website drugs.com. Arizona has pledged to stop using midazolam.

Because of the way the drug affects the brain, experts say, there’s a limit on how effective even a massive dose can be.

“It’s used to decrease anxiety — it’s not used by itself to produce anesthesia,” said S. Stevens Negus, a professor of pharmacology at Virginia Commonwealth University and one of sixteen pharmacologists who told the Supreme Court that midazolam was not being used appropriately in executions. “It will produce relaxation and that relaxation may be sufficiently severe to produce sleep, but in studies we’ve conducted, it does not eliminate sensation to pain.”

In Virginia, midazolam will be used as the first drug in a three-drug protocol, along with rocuronium bromide to cause paralysis and potassium chloride to stop the heart. The first and third drugs were produced by a compounding pharmacy; under a 2016 state law, the name and other particulars are kept secret.

A spokesman for the Virginia Department of Corrections said a similar protocol has “been used successfully . . . many times in states like Florida.”

Gray’s lawyers also say his traumatic upbringing and drug use was not fully explained or appreciated when he was sentenced to death. In a video released last week, family members say that as a child, Gray was beaten by his father almost daily with cords, pipes, and a leather belt labeled with Ricky’s name. He was violently raped by an older brother almost as often. Gray began using PCP as a small child and was high on the drug during his killing spree.

“Remorse is not a deep enough word for how I feel,” Gray says in the video. “I robbed them of a lifelong supply of joy. I’ve stolen Christmas, birthdays, and Easters, Thanksgivings, graduations, and weddings, children. . . . I’m sorry they had to be a victim of my despair.”

Two of Gray’s nieces say in the video that since going to prison, Gray has become a father figure, encouraging them to do well in school and stay out of trouble.

“If he was executed . . . I would just lose all my motivation, I just wouldn’t even have a purpose anymore,” one niece says.

Last week, lawyers for Gray presented the evidence of abuse to Judge Henry Hudson, who ruled that Gray failed to prove that use of midazolam, compounded or otherwise, is unconstitutional. Moreover, he said that Virginia offers all prisoners a constitutional alternative: the electric chair.