In a handful of majority-Muslim countries atheists can live safely, if quietly; Turkey is one example, Lebanon another. None makes atheism a specific crime. But none gives atheists legal protection or recognition. Indonesia, for example, demands that people declare themselves as one of six religions; atheism and agnosticism do not count. Egypt’s draft constitution makes room for only three faiths: Christianity, Judaism and Islam.

Sharia law, which covers only Muslims unless incorporated into national law, assumes people are born into their parents’ religion. Thus ex-Muslim atheists are guilty of apostasy—a hudud crime against God, like adultery and drinking alcohol. Potential sanctions can be severe: eight states, including Iran, Saudi Arabia, Mauritania and Sudan have the death penalty on their statute books for such offences.

In reality such punishments are rarely meted out. Most atheists are prosecuted for blasphemy or for inciting hatred. (Atheists born to non-Muslim families are not considered apostates, but they can still be prosecuted for other crimes against religion.) Even in places where laws are lenient, religious authorities and social attitudes can be harsh, with vigilantes inflicting beatings or beheadings.

Many, like Kacem el-Ghazzali, a Moroccan, reckon the only solution is to escape abroad. The 23-year-old was granted asylum in Switzerland after people found out he was the author of an anonymous blog, Atheistica.com. Even in non-Muslim lands ex-believers are scared of being open, says Nahla Mahmoud, a 25-year-old Sudanese atheist who fled to Britain in 2010. “Muslim communities here don’t feel comfortable with having an ex-Muslim around,” she says, noting that extremists living in the West may harass non-believers there too.

Facebook groups for atheists, mostly pseudonymous, exist in almost every Muslim country. Social media give non-believers more clout—but also make them more conspicuous, and therefore vulnerable. But the real blame lies with religious intolerance. In the 1950s and 1960s secularism and tolerance prevailed in many majority-Muslim countries; today religion pervades public and political life. Sami Zubaida, a scholar at London’s Birkbeck College, speaks of increasing polarisation, with “growing religiosity at one end of the spectrum and growing atheism and secularism at the other.”