Ricky Gray is escorted from the county courthouse in Culpeper, Va., on Jan. 3, 2007, after a preliminary hearing. (Mike Morones/AP)

A federal judge in Virginia has declined to halt the execution of convicted killer Ricky Gray, scheduled to take place Jan. 18.

Gray’s attorneys argued in a hearing this month that the drugs the state would use to execute Gray are untested and potentially torturous.

But U.S. District Judge Henry Hudson concluded that “any discomfort experienced by Gray in the execution process is unlikely to cause serious pain or suffering.” The possibility of some “incremental” increase in pain was outweighed, he said, by the harm of delaying the execution, given “the appalling number of people, including two children ages four and nine, whom Gray tortured and killed.”

Gray, 39, and his nephew Ray Dandridge killed a Richmond family of four on Jan. 1, 2006. The parents and two children were bound, beaten and stabbed before their throats were slit and their home set on fire. Gray was sentenced to life in prison for killing Bryan and Kathryn Harvey, ages 49 and 39. He was sentenced to death in the slaying of their daughters, Stella and Ruby.

Gray was also implicated in the killing of another Richmond family a few days later; Dandridge pleaded guilty to murder in that case. And Gray has confessed to killing his wife, Treva Terrell Gray, two months before the January rampage.

He has since filed several challenges and appeals, Hudson noted, leading the judge to conclude that this effort was merely another attempt to delay execution. Gray has separately asked Virginia Gov. Terry McAuliffe to commute his sentence to life in prison, arguing that the severe sexual and physical abuse he suffered as a child and his resulting PCP use were not fully explained at trial.

Gray’s attorneys said they also plan to appeal to the U.S. Court of Appeals for the 4th Circuit.

“It is our position that it is unconstitutional for the VDOC to carry out an execution that risks chemically torturing a prisoner to death,” attorney Lisa Fried said in a statement.

Virginia’s lethal injection protocol uses three drugs: midazolam hydrochloride as a sedative, rocuronium bromide to halt breathing and potassium chloride to stop the heart. The first and third drugs were produced by a pharmacy whose name is kept secret from the public under a state law passed last year. Without more information about the pharmacy, Gray’s attorneys said, there is a risk that the execution will amount to cruel and unusual punishment. No other state has yet performed an execution with these compounded drugs.

Gray’s lawyers also unsuccessfully argued that it is unconstitutional to keep the name of the pharmacy and other details secret.

Secrecy is necessary, officials say, because public pressure on pharmacies has made it difficult to obtain the drugs necessary to carry out executions.

Gray’s attorneys also maintained that the use of midazolam of any kind is troubling. In several other states, prisoners sedated with the drug have subsequently moved in apparent pain, made gasping or choking noises and even talked. In December, Arizona agreed to stop using the sedative.

But as Hudson noted, the Supreme Court in 2015 narrowly ruled that the use of midazolam is constitutional. The judge agreed with state officials that there is no evidence that compounded drugs are inferior to those made at traditional pharmacies.

Hudson also rejected a suggestion from Gray’s lawyers that a firing squad be used instead, saying he had no authority to order an execution method not prescribed by state law.