ATMORE, Ala. (AP) — A divided U.S. Supreme Court said Alabama can proceed Thursday night with the lethal injection of an inmate convicted in a 1999 workplace shooting, vacating two lower court rulings that sided with the condemned man and his request for a different method of execution.

The 5-4 decision reversed rulings by the 11th U.S. Circuit Court of Appeals and a federal judge that the lethal injection could not go forward after Alan Miller’s attorneys said the state lost his paperwork requesting his execution be carried out using nitrogen hypoxia, a method legally available to him but one never used before in the U.S.

Miller, 57, was convicted of killing three people in a 1999 workplace rampage, drawing the death sentence. A judge blocked the state’s execution plan earlier this week.

Miller testified that he had turned in paperwork four years ago selecting nitrogen hypoxia as his execution method, putting it in a slot in his cell door at the Holman Correctional Facility for a prison worker to collect.

On Tuesday, U.S. District Judge R. Austin Huffaker Jr. issued a preliminary injunction blocking the state from killing Miller by any means other than nitrogen hypoxia, after finding it was “substantially likely” that Miller “submitted a timely election form even though the State says that it does not have any physical record of a form.”

Thursday night’s Supreme Court ruling vacated that injunction at the request of the state. Justices lifted the stay at about 9 p.m. giving the state a three hour window to get the execution underway before the death warrant expires at midnight. The July execution of Joe Nathan James took more than three hours to get underway after the state had difficulties establishing an intravenous line.

Although Alabama has authorized nitrogen hypoxia as an execution method, it has never executed anyone with that method and the state’s prison system has not finalized procedures for using it to carry out a death sentence.

Nitrogen hypoxia is a proposed execution method in which death would be caused by forcing the inmate to breathe only nitrogen, thereby depriving him or her of the oxygen needed to maintain bodily functions. It is authorized as an execution method in three states but no state has attempted to put an inmate to death by the untested method. Alabama officials told the judge they are working to finalize the protocol.

Many states have struggled to buy execution drugs in recent years after U.S. and European pharmaceutical companies began blocking the use of their products in lethal injections. That has led some to seek alternate methods.

When Alabama approved nitrogen hypoxia as an execution method in 2018, state law gave inmates a brief window to designate it as their execution method. Miller testified that he opted for nitrogen when the form was distributed on death row because he disliked needles.

“That the state is not yet prepared to execute anyone by nitrogen hypoxia does not mean it will harm the state or the public to honor Miller’s timely election of nitrogen hypoxia. By contrast, if an injunction does not issue, Miller will be irrevocably deprived of his choice in how he will die — a choice the Alabama Legislature bestowed upon him,” Huffaker wrote.

Miller had visits from family members and an attorney on Thursday as he waited to see if his execution would go forward. He was given a food tray that included meatloaf, chuckwagon steak, macaroni and french fries, the prison system said.

Prosecutors said Miller, a delivery truck driver, killed co-workers Lee Holdbrooks and Scott Yancy at a business in suburban Birmingham and then drove off to shoot former supervisor Terry Jarvis at a business where Miller had previously worked. Each man was shot multiple times and Miller was captured after a highway chase.

Trial testimony indicated Miller believed the men were spreading rumors about him, including that he was gay. A psychiatrist hired by the defense found that Miller suffered from severe mental illness but also said Miller’s condition wasn’t bad enough to use as a basis for an insanity defense under state law.