HUNTSVILLE, Texas — A member of the "Texas 7" gang of escaped prisoners won a reprieve Thursday night from execution for the fatal shooting of a suburban Dallas police officer after claiming his religious freedom would be violated if his Buddhist spiritual adviser wasn't allowed to be in the death chamber with him.

The U.S. Supreme Court blocked Patrick Murphy's execution about two hours after he could have been executed.

Patrick Murphy Texas Department of Criminal Justice / AP

Murphy's attorneys had said that Texas prison officials' efforts to prevent the inmate's spiritual adviser, a Buddhist priest, from being with him when he is put to death violated Murphy's First Amendment right to freedom of religion. Murphy, 57, became a Buddhist almost a decade ago while incarcerated.

Lower courts had rejected Murphy's argument.

But in a concurring opinion Thursday night, the newest justice on the court, Brett Kavanaugh, said the Texas prison system allows a Christian or Muslim inmate to have a state-employed Christian or Muslim religious adviser present either in the execution room or in the adjacent viewing room. But inmates of other religious denominations who want their religious adviser to be present can have the adviser present only in the viewing room and not in the execution room itself, he said.

"As this Court has repeatedly held, governmental discrimination against religion, in particular, discrimination against religious persons, religious organizations, and religious speech_violates the Constitution," he wrote. "The government may not discriminate against religion generally or against particular religious denominations."

Kavanaugh said Texas can't move forward with Murphy's punishment unless the state permits his Buddhist adviser or another Buddhist reverend of the state's choosing to accompany Murphy in the chamber during the execution.

"What the State may not do, in my view, is allow Christian or Muslim inmates but not Buddhist inmates to have a religious adviser of their religion in the execution room," the justice said.

Kavanaugh did not hear any death penalty cases in his 12 years as an appeals court judge joining the Supreme Court.

Texas Department of Criminal Justice spokesman Jeremy Desel the state would review the ruling to determine how to respond.

Desel said Murphy would be returned from the Huntsville Unit prison, where executions are carried out, to the Polunsky Unit, about 45 miles to the east, where death row inmates are imprisoned.

"I knew there was a thin thread of possibility," a smiling Murphy said from a holding cell just a few feet from the death chamber after he was told by the warden he received a reprieve.

Texas officials argued to the court, citing security concerns, that only chaplains who had been extensively vetted by the prison system were allowed within the chamber. While Christian and Muslim chaplains were available, no Buddhist priest was. Prison officials allowed Murphy to visit with his spiritual adviser for about 40 minutes Thursday afternoon.

Murphy was among the inmates who escaped from a South Texas prison in December 2000 and then committed numerous robberies, including the one in which they shot 29-year-old Irving police Officer Aubrey Hawkins 11 times, killing him.

Hawkins, who had been with the Irving police force about 14 months, had just finished Christmas Eve dinner with his family when he responded to the call about the robbery at a sporting goods store and was ambushed.

The escaped inmates were arrested a month later in Colorado, ending a six-week manhunt. One of them killed himself as officers closed in and the other six were convicted of killing Hawkins and sentenced to death. Murphy would have been the fifth to be executed. The sixth inmate, Randy Halprin, has not been given an execution date.

Murphy would have been the fourth inmate put to death this year in the U.S. and the third executed in Texas, the nation's busiest capital punishment state.

In February, the Supreme Court rejected a request from a Muslim death row inmate in Alabama to have his Islamic spiritual adviser be present in the execution chamber. Dominique Ray, who was executed, also argued his religious rights were violated because Alabama allows a Christian chaplain employed by the prison to be in the execution chamber.

Murphy was convicted under Texas' law of parties, which holds a person criminally responsible for the actions of another if they are engaged in a conspiracy.

Murphy's attorneys had also asked the Texas Court of Criminal Appeals to stop his execution, arguing his death sentence is unconstitutional because he was only the lookout during the robbery, never firing at Hawkins because he had left the scene before the shooting began.

The appeals court earlier this week turned down the request while the Texas Board of Pardons and Paroles declined to recommend either a commutation of his sentence or a 90-day reprieve.

"It is unconscionable that Patrick Murphy may be executed for a murder he did not commit that resulted from a robbery in which he did not participate," his attorneys, David Dow and Jeff Newberry, said in a statement.

Toby Shook, the lead prosecutor who handled Murphy's case and those of the other five members, said Murphy actively participated in the robbery, monitoring a police scanner from a getaway vehicle and telling the other inmates when Hawkins was coming to the back of the store.

"He alerted them. That allowed them to set up their ambush," said Shook, who is now a criminal defense attorney in Dallas.

Murphy was serving 50 years for a Dallas sexual assault but was only 15 months away from being released on mandatory parole when he took part in the prison escape.

Shook said Murphy has a very long and violent criminal history, including molesting his step-sister and pulling a gun on his father.

"They all were violent felons," Shook said. "So, he fit in perfectly with the rest of the Texas 7. He actively participated in all their robberies and all their crimes when they were out on the run."