WASHINGTON — The Supreme Court on Thursday stayed the execution of a Buddhist inmate in Texas whose request that his spiritual adviser be present in the execution chamber had been denied.

In a brief, unsigned order, the court said that Texas may not execute the inmate, Patrick H. Murphy, “unless the state permits Murphy’s Buddhist spiritual adviser or another Buddhist reverend of the state’s choosing to accompany Murphy in the execution chamber during the execution.”

Justices Clarence Thomas and Neil M. Gorsuch said they would have allowed the execution to proceed.

In a concurring opinion, Justice Brett M. Kavanaugh wrote that the state’s policy of allowing only Christian and Muslim chaplains to attend executions amounted to unconstitutional religious discrimination. “The government may not discriminate against religion generally or against particular religious denominations,” he wrote.

“In this case,” he wrote, “the relevant Texas policy 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 — for example, Buddhist inmates such as Murphy — who want their religious adviser to be present can have the religious adviser present only in the viewing room and not in the execution room itself for their executions.”