MUSLIMS the world over are horrified by the executions carried out by Islamic State (IS) in the name of their religion. On June 28th the Syrian Observatory for Human Rights, an NGO based in Britain, said it knew of more than 3,000 in the past year. More than half were of civilians—and 74, of children. Yet the self-declared caliphate is not the only Muslim “state” keen on the death penalty and other brutal punishments. At least nine countries have stoning as a judicial sentence, and five have amputation. All are Islamic.

Why? Islam’s sacred texts are not more bloodthirsty than those of Judaism or Christianity. The Old Testament names 36 misdeeds, including using magic and striking a parent, as meriting death; the Koran just two: hiraba (“spreading mischief”) and murder. It says that the family of a murder victim may forgive and therefore spare the killer. Death, stoning, amputation and lashes are reserved for a small number of serious crimes, including theft and adultery, collectively known as hudud.

Under the Ottoman empire, just one person was stoned to death in 600 years. But since the early 1970s, when only Saudi Arabia ruled according to the Koran, the trend has been for ever-harsher punishments. In 1979 post-revolutionary Iran brought in sharia (Islamic law); Pakistan, Afghanistan and Sudan soon followed. In 2014 Brunei introduced a strict sharia code; Malaysia’s opposition wants to see hudud laws enforced. “Spreading mischief”, literally meaning “waging death against Allah and his angels”, is generally now taken to include homosexuality and apostasy. Such definition-stretching is possible since Islamic law relies on not only the Koran, but also thousands of hadith—supposed sayings and doings of the Prophet Muhammad—and later scholarship. For some crimes, judges can choose to order whippings and the like, even if the Koran does not insist on it—and many do.

The intertwining of state and religion is only a partial explanation. Though all Muslim countries mention Islam in their constitutions, they differ in the weight they give it. Saudi Arabia and Pakistan regard it as the only source of law. But far more pick and mix. Egypt’s criminal code is inspired by those of Britain and France. Across much of Iraq, tribal law holds sway.

A bigger reason for reliance on bloody sentences, often carried out in public, is the instability that plagues the Islamic world. “Governments tend to use Islamic law according to their interests,” says Ahmed Taleb, a cleric in Lebanon. An ongoing flurry of death sentences in Egypt targets the Muslim Brotherhood, the main opposition. The Saudi regime must curry favour with hardline clerics, who prop it up. Jordan and Pakistan recently revived the death penalty in response to growing insecurity: Jordan after IS burned to death a pilot who crashed in Syria; Pakistan after the Taliban slaughtered children in a school.

Reformist scholars point to Koranic verses and hadith in favour of mercy, and the strict conditions set for the harshest punishments. A conviction for adultery, for example, requires eyewitness testimony from four male Muslims—a high bar. They argue that the use of religion to cloak political decisions is distorting Islam to such an extent that some rulings contradict the Koran. Today adultery is punishable by stoning, whereas the Koran prescribes 100 lashes—and 80 lashes for falsely accusing another. According to Sadakat Kadri, a barrister in London who studies Islamic law, in the seventh century, when Islam was founded, that was rather progressive.

Others argue that interpretation needs to move with the times. “History shows that the penalty is related to the circumstances of the society,” says Hossam Mekawy, an Egyptian judge. But public opinion, as well as hardline clerics, makes talk of reform difficult: a Pew survey in 2013 found that many Muslims in South Asia, the Middle East and north Africa favoured cutting off thieves’ hands and executing apostates. Governments who ease up do so de facto rather than de jure: Iran imposed a moratorium on stoning for adultery, for instance, rather than getting rid of it.

Liberal lawyers in Saudi Arabia want more penalties codified to stop judges using harsher sentences than prescribed: more than half of this year’s death sentences have been for crimes for which other sentences were available. Still, as a lawyer in Riyadh, the Saudi capital, points out, that brings you only so far. “It’s impossible to get away from the fact that the current jurisprudence says lashes, stoning and the death penalty are required in certain cases,” he says. Without open debate about crime and punishment within the Islamic world, the killing and maiming will continue.