TURKEY’s directorate of religious affairs, known as the Diyanet, has a knack for odd and outrageous pronouncements. The body had already made it known that celebrating the new year, playing the lottery, feeding dogs at home, and purchasing Bitcoin were incompatible with the principles of Islam; men should not dye their moustaches, nor couples hold hands. (Divorcing one’s spouse by text message, however, is OK.) But when the Diyanet declared, in a glossary entry spotted on its website at the start of this year, that according to Islamic law girls as young as nine were able to marry, the ensuing outcry was bigger than in recent memory. Some critics called for the institution to close. The Diyanet protested that it was only cataloguing, not endorsing, principles laid down by Islamic jurists, and soundly condemned child marriage in a sermon. (The legal age in Turkey is 18.) The offending post was taken down.

To critics of the Diyanet the incident, the latest in a series of controversies, offered yet more evidence of the directorate’s transformation. Over the past decade, and especially amid the purges that followed a coup attempt in 2016, Turkey’s president Recep Tayyip Erdogan and his Islamist-rooted Justice and Development (AK) party have tightened their grip on state institutions, restricting dissent within and without. The Diyanet has been no exception. Designed as a check against political Islam, the directorate has become one of its main platforms.

In constitutional terms, Turkey is a secular country. But whereas in most places this implies the separation of religion and state, in Turkey it means state control over religion. Enter the Diyanet. The brainchild of modern Turkey’s founding father, Kemal Ataturk, and his supporters, the directorate replaced the office of the Sheikh ul-Islam as the country’s main religious authority on March 3rd 1924, the day parliament abolished the Ottoman caliphate. A bureaucratic behemoth, the Diyanet employs all of Turkey’s imams, organises Koran courses for children, issues its own, nonbinding interpretations of Islamic norms, and pens sermons to be read in the country’s 90,000 mosques.

For most of its history, the Diyanet has accommodated the politics of the secular establishment, embracing a version of Islam at ease with modernity, and keeping fundamentalism at bay. (Support for sharia in Turkey is considerably lower than in most of the Muslim world.) Under AK, however, it seems less bound by secular norms than ever before. “The Diyanet of today has a more Islamist, more Arab worldview,” says Mustafa Cagrici, the mufti of Istanbul from 2003 to 2011. Much of this has to do with the influx of hardline interpretations of Islam from abroad and Turkey’s budding relations with foreign Islamist groups.

Despite a few early signs to the contrary, the moderate, critical current within the Diyanet has folded under increasing pressure from hardliners. In 2004 the Diyanet announced a project to verify and reinterpret the hadith, or the collected words and acts of the Prophet Muhammad, in a modern light. Following grumblings by powerful Islamic brotherhoods and conservatives inside AK, the fruit of the Diyanet’s labours, a seven-volume study far less ambitious than its designers intended, took a decade to appear, and did so to minimal fanfare. Asked if a similar project might even be started today, Mr Cagrici throws back his head. “No way,” he says. The Diyanet is bigger (it employs 117,000 people) and wealthier (its budget has grown at least fourfold since 2006) than at any time in its history, but it is also more firmly under the government’s thumb.

For almost a century, the Diyanet has walked a fine line to help safeguard Turkey’s identity as a country that is both Muslim and secular. By starting to endorse a reading of Islam that is at odds with what are still the laws of the state it serves, it now appears to be veering off course. Turkey is not about to become a theocracy. But the heterodox, tolerant Islam that has set it apart from much of the Middle East is under threat. Despite its original purpose, the Diyanet is not helping.