(Reuters) - An inmate who was part of a murderous band of prison escapees dubbed the “Texas 7” won a reprieve from his death sentence on Thursday as the U.S. Supreme Court ordered the state to allow a Buddhist spiritual adviser to accompany him to the execution chamber.

The 11th-hour stay was granted to Patrick Murphy, 57, convicted for his role in the killing a police officer at a sporting goods store on Christmas Eve in 2000 after escaping from a maximum-security prison days earlier.

The high court rendered its decision more than an hour after Murphy had been scheduled to die by lethal injection at the state’s prison facility in Huntsville.

“As this court has repeatedly held, governmental discrimination against religion — in particular, discrimination against religious persons, religious organizations, and religious speech — violates the Constitution,” Justice Brett Kavanaugh wrote in a concurring opinion.

Two of the nine justices - Clarence Thomas and Neil Gorsuch - dissented.

The Thursday decision differs from a ruling by the Supreme Court in February, when justices voted 5-4 to allow an execution in Alabama to proceed and denied a request by the condemned inmate, who was Muslim, for an imam’s presence in the execution chamber.

It was unclear why the court ruled differently on Thursday, but Kavanaugh noted that Murphy made his request to the state in a “sufficiently timely manner, one month before the scheduled execution.”

Murphy’s lawyers filed an appeal with the Supreme Court on Thursday, seeking a stay if Texas failed to provide him with a Buddhist minister in the death chamber.

“If a stay is not granted, Murphy will suffer irreparable injury because he will be executed under circumstances that violate his First Amendment and statutory rights to freedom of religion,” David Dow, his lawyer, wrote in the petition.

Texas allows a Christian or Muslim religious adviser for a condemned inmate to be present in either in the execution room or in the adjacent viewing room. But inmates of other religious faiths, such as Murphy, a Buddhist, were only allowed to have their religious adviser in the viewing room, Kavanaugh noted.

“In my view, the Constitution prohibits such denominational discrimination,” he wrote.

Because the ruling came after the expiration of the death warrant, the case will be returned to the district court level, and the execution rescheduled.

Murphy was serving a 50-year sentence for aggravated sexual assault when he and six other inmates broke out of maximum- security prison in Kenedy, Texas, on Dec. 13, 2000, according to court documents.

Eleven days later, Murphy and the other escapees robbed a sporting goods store in Irving. Police officer Aubrey Hawkins, 31, was shot and killed by the group as the men fled, according to court filings. They were apprehended about a month later at a Colorado mobile home park, where one of the escapees committed suicide.

Murphy was sentenced to die in 2003 after he was convicted of capital murder of a police officer.

Murphy was in a vehicle, serving as a lookout and did not shoot Hawkins during the robbery, according to prosecutors. But he was still convicted of murder under the state’s law of parties, a statute that holds a person criminally responsible if they act as an accomplice.