The Supreme Court on Wednesday night granted a last-minute reprieve to a Texas inmate who wants his preacher physically by his side and audibly praying for him at the time of his execution.

Just hours before John Henry Ramirez was to be executed, the court issued a one-paragraph order granting his request for a stay. The court will order full briefing and argument in the case, which will be added to the court’s docket in October or November.

The request by Ramirez, 37, is the latest conflict over when a death-row inmate’s spiritual requests conflict with the security and decorum prison officials say is needed during an execution.

Ramirez was convicted of the 2004 slaying of 46-year-old Pablo Castro, who was killed as he took out the trash from a Corpus Christi convenience store. Prosecutors say Ramirez stabbed Castro 29 times during a string of robberies in which Ramirez and two women sought money for drugs. In killing Castro, Ramirez got $1.25. He later fled to Mexico but was arrested 3½ years later.

Ramirez has developed a relationship with Dana Moore, the pastor of Second Baptist Church in Corpus Christi. Moore has been driving 300 miles to visit Ramirez in prison for four years.

The inmate wants Moore to be able to touch him and pray out loud for him at the moment of execution. Prison officials have said no, arguing that direct physical contact during lethal injection is a security risk, and that praying out loud could be disruptive.

A federal judge in Houston and a split panel of the U.S. Court of Appeals for the 5th Circuit agreed with the state.

U.S. Circuit Judge Priscilla Owen questioned Ramirez’s motivation.

“Ramirez’s present demand that Pastor Moore be permitted to lay hands on him throughout the execution process and until death has occurred, raises concern that Ramirez’s change in position has been asserted to delay his execution,” Owen wrote.

“Though I do not doubt the sincerity of Ramirez’s religious beliefs or those of his pastor, the shifting of Ramirez’s litigation posture indicates that the change in position is strategic and that delay is the goal.”

Texas had asked the Supreme Court to let the execution go forward.

“That a state may not impose policies coercing an inmate to do what his religious [tenets] forbid does not mean that it must accede to his every religious demand,” Texas said in its filing. “By design, prisons impede inmates’ freedom to behave as they might wish, which, necessarily limits some of their religious behavior.”

Seth Kretzer, Ramirez’s lawyer, has argued that prison officials are denying the inmate’s constitutional right to exercise his religion, and violating a law that accommodates such freedom, the Religious Land Use and Institutionalized Persons Act (RLUIPA).

Texas officials “are honest in saying that they want the execution chamber to be a godless vacuum,” Kretzer wrote in his Supreme Court filing. “That was their most recent policy amongst the four they have promulgated in the last two years. But the First Amendment and RLUIPA do not allow the prohibition on religious exercise.”

The Supreme Court has been increasingly siding with death-row inmates in requiring prison officials to allow spiritual advisers.

The court in 2019 stopped the execution of another inmate who complained his Buddhist adviser was kept from him, while the prison clergy included Christian and Muslims.

Texas sought to eliminate the issue by not allowing any spiritual advisers at executions. But the high court said inmates could not be denied such counseling at the time of death.

The two women who took part in the robberies with Ramirez are in prison.

The case is Ramirez v. Collier.