Domineque Ray (pictured) had been scheduled to die for the rape and murder of a 15-year-old girl in 1995

A Muslim man on death row won a last-minute stay of execution on Wednesday when a federal court ruled that his constitutional rights had been violated.

Domineque Ray, 42, who had been scheduled to die on Thursday for the rape and murder of 15-year-old Tiffany Harville in 1995, was granted the stay of execution after the state of Alabama refused to provide an imam to accompany him into the death chamber.

The U.S. Court of Appeals, headquartered in Atlanta, overturned a Montgomery federal judge's denial of a stay last week.

'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,' the judges said in their ruling.

The First Amendment forbids public authorities from favoring one religion over another, or from preventing the free practice of faith.

As his execution date approached, Ray, who converted to Islam while in prison, demanded the right to be escorted to the death chamber by an imam.

As his execution date approached, Ray, who converted to Islam while in William C. Holman Correctional Facility (pictured), demanded the right to be escorted to the death chamber by an imam

He objected to Alabama's practice of allowing a Christian prison chaplain, who is a prison system employee, to stand near the inmate during the lethal injection and to pray with the inmate if the inmate requests it.

The conservative southern state allows a salaried prison chaplain into the execution chamber but only allows unauthorized spiritual guides to accompany a condemned prisoner to the door of the room.

Ray's lawyers filed an emergency challenge to the ruling last week, but it was denied by a lower court, which argued that Alabama could not allow 'the risk posed by allowing another cleric into the execution chamber.'

But the appeals court said that Alabama had presented no evidence of any such security risk, nor why it would be a problem to train an imam in prison protocol in time for the execution.

The state of Alabama announced after the ruling that it would take its case to the Supreme Court.