McALESTER, Okla. — An appeals court halted the execution of an Oklahoma man with just hours to spare Wednesday after his attorneys said they had uncovered new evidence, including a fellow inmate’s claim that he overheard another man convicted in the case admit he acted alone.

Richard Eugene Glossip was twice convicted of ordering the killing of Barry Van Treese, who owned the Oklahoma City motel where Glossip worked. Motel handyman Justin Sneed admitted robbing and beating Van Treese with a baseball bat, but said he did so only after Glossip promised to pay him $10,000.

Prosecutors alleged Glossip was afraid Van Treese was about to fire him for embezzling money and poorly managing the motel.

Glossip, 52, was scheduled to be executed at 3 p.m. Wednesday, but the Oklahoma Court of Criminal Appeals agreed just before noon to reschedule the lethal injection for Sept. 30. Glossip’s lawyers said they obtained a signed affidavit from another inmate, Michael Scott, who claims he heard Sneed say “he set Richard Glossip up, and that Richard Glossip didn’t do anything.”

His attorneys also argued that Glossip’s trial attorneys didn’t present enough evidence to discredit Sneed, who was sentenced to life in prison and testified against Glossip. They presented an affidavit from an admitted methamphetamine dealer who said he frequently saw Sneed use the drug and trade stolen items for it.

The court said it granted the last-minute request “in order for this court to give fair consideration” to Glossip’s new claims.

Glossip attorney Don Knight said he was inside the prison speaking to Glossip when a prison official informed them the execution had been stayed.

“It took his breath away for a second,” Knight said. “We were kind of doing a fist bump through the glass. He was really joyous, truly joyous. It was a wonderful moment.”

Oklahoma Attorney General Scott Pruitt said the Van Treese family has waited “18 agonizing years for justice to be realized,” but said he was confident the court wouldn’t find any evidence to overturn the two juries that convicted Glossip.

Van Treese was found beaten to death at the Best Budget Inn on Jan. 7, 1997. He was staying there while delivering paychecks and picking up large amounts of money for deposit.