Image copyright Alabama Dept of Corrections via AFP

A federal appeals court has blocked the execution of a Muslim inmate in Alabama after the state refused to allow his imam to be present at his death.

Domineque Ray, convicted of murdering a 15-year-old girl in 1995, was scheduled for execution on Thursday.

But his lawyers argued that the state infringed on his religious rights by denying his request for an imam over a chaplain during the execution.

The state has now appealed the stay to the US Supreme Court.

A three-judge panel reversed an earlier court ruling and delayed Ray's death by lethal injection, writing in an opinion that Ray had a "powerful" claim against the state.

"The central constitutional problem here is that the state has regularly placed a Christian cleric in the execution room to minister to the needs of Christian inmates, but has refused to provide the same benefit to a devout Muslim and all other non-Christians."

According to the Alabama Department of Corrections (ADOC), Christian chaplain Chris Summers has witnessed nearly every execution since 1997.

Ray's complaint requests the court to not mandate the chaplain's presence in his execution chamber and to allow his imam instead, "so that he may receive spiritual guidance and comfort from a cleric of his own faith" at the time of his death.

The federal judges also noted that Ray has been a committed Muslim since 2006, and even the ADOC is not disputing the "sincerity of Ray's religious beliefs".

In addition, his imam, Yusef Maisonet, has been providing religious services to prisoners in the ADOC since 2015.

The ADOC insists, however, that it will not allow a non-employee to be in the chamber in place of the chaplain. The imam could be present in the witness room and meet Ray ahead of the execution.

Image copyright Getty Images Image caption The state said Ray's imam could be in the witness room but would not be allowed inside the execution chamber

An earlier District Court ruling said Ray had taken too long to raise the legal issues against the ADOC, "waiting until the eleventh hour" to seek a religious exemption.

Ray has been an inmate for close to 20 years, the New York Times reported.

The prison warden had informed Ray of the death penalty practices on 23 January, and Ray's lawyer contends he was unaware of the religious policies until then, US media reported.

Ray's counsel had then suggested that the state train and screen his imam, who is already familiar with prison visitations, but the state responded by saying "it could not do so".

Judge Stanley Marcus, writing for the federal appeals panel, said the state cannot appear to favour Christianity over Islam and then say it cannot provide the same rights to both.

"Quite simply, the power, prestige, and support of the state may not be placed behind a particular religious belief."

"Alabama appears to have set up precisely the sort of denominational preference that the Framers of the First Amendment forbade."

The First Amendment states that the US government cannot make any laws regarding establishment of religion or prohibiting the exercise religious beliefs.

The Alabama Council of Islamic Relations (CAIR) said they welcomed the appeals decision and "hope Mr Ray will ultimately be provided equal access to spiritual guidance".