(JTA) — Britain’s High Court has ordered a London coroner to respect the religious beliefs of the deceased’s family when determining the order in which bodies can be buried.

Senior coroner Mary Hassell had announced that she would not prioritize Jewish and Muslim burials over others, despite the fact that Jewish and Islamic law requires bodies of the deceased to be buried as soon as possible after death, ideally on the same day.

The High Court on Friday called Hassell’s “cab-rank rule” policy “unlawful, irrational” and “discriminatory,” according to the London-based Jewish Chronicle.

Hassell is the senior coroner at the St. Pancras Coroner’s Office in central London. Her jurisdiction covers the largest concentration of haredi Orthodox Jews in Europe and the United Kingdom’s biggest Muslim community.

The London-based Adath Yisrael Burial Society took Hassell to court alleging “widespread distress” among the two faith communities.

“The fundamental flaw in the present policy adopted by the defendant is that it fails to strike any balance at all, let alone a fair balance,” Lord Justice Singh wrote in his majority opinion.

“What on its face looks like a general policy which applies to everyone equally may in fact have an unequal impact on a minority. In other words, to treat everyone in the same way is not necessarily to treat them equally. Uniformity is not the same thing as equality,” the decision said.

The Jewish Chronicle reported in December that one woman made 210 phone calls to the St. Pancras Coroner’s Office before being assured that her father would be buried four days after his death. Another family was told it would have to wait two weeks for an autopsy to be performed before a funeral could be held.