Until this summer, Istanbul’s Church of the Divine Wisdom, known in the West as Hagia Sophia and in Turkey as Aya Sofya, was a palimpsest of three civilisations. Emperor Justinian commissioned it in 532 A.D. to serve as the seat of the Orthodox patriarch and more than ten thousand labourers toiled to realise his dream. The twenty-one-year-old Sultan Mehmet II, after conquering Istanbul in 1453, added four minarets around the original church and turned it into an imperial mosque. Mustafa Kemal Atatürk de-sanctified it by signing a decree in 1934 which transformed the seat of the Islamic caliphate into a secular museum. On July 10, 2020, Turkey’s president Recep Tayyip Erdoğan added a fourth layer to this unique palimpsest. With the stroke of his pen, he de-museumised and re-sanctified it, and the Museum of the Divine Wisdom reversed to Aya Sofya Camii. A key promise of his Islamist-rooted party’s political agenda, after eighteen years in power, finally bore fruit.

Why now? Since it metamorphosed into a mosque half a millennium ago, Muslims remained conflicted about Hagia Sophia’s Islamic value. The building signifies Mehmet’s world-conquering posture for hawkish Muslims but also served as a graveyard of Christian crusaders. Enrico Dandolo, a Venetian Doge who fought during the Fourth Crusade was buried there; his name ornaments a lid of a sarcophagus in Hagia Sophia’s upper south gallery. A nearby mosaic depicts Byzantine Empress Zoe – a poisoner and a slave to luxury who wouldn’t look out of place in Game of Thrones. Such symbols of Christendom led some Muslims to claim it is sacrilegious to pray there. Precisely because of this hybrid status it was an ingenious tactic to museumise Hagia Sophia in 1934.

The idea originated from Thomas Whittemore. The Boston-born vegetarian held an art history degree from Harvard, mingled with the likes of Gertrude Stein and Henri Matisse, grew an interest in Byzantine art, founded the Byzantine Institute in 1930, befriended Atatürk and convinced Turkey’s founder to restore Hagia Sophia’s mosaics, which had remained covered in Islamic motifs for five centuries. That year, Greece’s prime minister Eleftherios Venizelos, an Orthodox Christian, nominated Atatürk for the Nobel Peace Prize. After the Museum of Divine Wisdom opened in 1935, Whittemore gave tours to Edward VIII, Wallis Simpson, John D. Rockefeller Jr. and other eminent figures.

This explains why some Muslims have treated Hagia Sophia like a medieval love affair for decades. A sacred Islamic space stained by museologists and a secularist leader who was showered with accolades for that unspeakable act, Hagia Sophia had to be re-conquered before Muslims could re-appreciate her beauties. For secular Turks, Hagia Sophia was a reminder of the radicalism of Atatürk’s modernisation project. That an Ottoman Army commander who defended the Ottoman Caliph and corresponded in Arabic script could wield enough power to turn Istanbul’s most sacred mosque into a blockbuster museum (operated by a Swiss company, it attracted three and a half million visitors each year) both bewildered and inspired. The 1934 decree cemented Atatürk’s reputation as a Napoleonic hero – a role Erdoğan became determined to play on his own terms.

When I visited in 2014, joining a queue that stretched over two hundred meters, not many Turks were inside Hagia Sophia. In their stead, Americans lined the entrance, Instagramming a clock-room named Horologion that Byzantines used to determine the time and marvelling at the Empress Lodge’s green marbles. I was there to investigate a mystery. In 2014, a nationalist historian and MP claimed that Atatürk’s de-sanctifying decree from 1934 was forged. Atatürk, he said, wanted Hagia Sophia to remain as a mosque but someone had faked his signature as part of a heinous plot. Necip Fazıl Kısakürek, an avant-garde Islamist poet and leading antisemite (he translated and published The Protocols of the Elders of Zionin Turkey) from the twentieth century, made similar claims in the 1960s, describing Hagia Sophia’s museumisation as a “western conspiracy” to “cage the essential spirit of Turks”. As Kısakürek’s ideological disciple, Erdoğan wholeheartedly agreed. In a 1994 interview with the Islamic magazine al-Mujtama, as Istanbul’s newly elected mayor, he pledged one day to re-mosque Hagia Sophia.

But over the next two decades, Erdoğan grew into a masterful politician – arguably the most skilful to emerge since Atatürk. As his Islamism appeared to mellow, and realpolitik determined his ascent to power, Erdoğan shelved that project and presented himself as a conservative democrat eager to usher his country into the European Union. By the time of my visit, the forged-signature-of-Atatürk theory wasn’t taken seriously; people didn’t even oppose it and nobody acted on the claim. “The bill of turning Hagia Sophia into a mosque would be too expensive,” Erdoğan told a group of students on national television in 2019. “I haven’t yet lost my direction as a leader to fall into the trap of opening Hagia Sophia for prayers.”

Erdoğan’s change of heart came shortly afterwards, around the time that he lost the 2019 mayoral elections. Istanbul elected the mayoral candidate from The Republican People’s Party, the party Atatürk founded. Its leader, Ekrem İmamoğlu, recited Qur’an in a mosque, appeared as pious as Erdoğan and his ilk, and won the elections with a close to 10 per cent margin. For the first time, Erdoğan’s political polarisation tactics had failed and Atatürk’s party proved its maturity by moving away from its founder’s soulless modernisation.

Clearly the government wanted to gain political points. But the legal process which turned Hagia Sophia back into a mosque makes little sense. It relies on Sultan Mehmet II’s fifteenth-century will which proclaims: “whoever changes the status of the Hagia Sophia will have committed the most grave sin of all… the curse of Allah, his Prophet, his angels and all rulers and all Muslims will forever be upon him.” This would re-legitimize laws that expired with Turkey’s foundation in 1923. By the same logic, Ottoman Royal Family’s descendants, sent into exile by Atatürk, can lay claim to whole Istanbul neighbourhoods – including Beşiktaş or Cihangir, where I live.

But the decree Erdoğan tweeted on July 10 was telling. It was almost a mirror image of Atatürk’s historic decree – as if Erdoğan wanted to startle secularists in the same way Atatürk startled Islamists in 1934. As such, it was a reminder of Islamist traumas: the abolishing of the caliphate and bans on the Arabic call to prayer and headscarves.

To the government’s dismay, the opposition wasn’t startled one bit. Instead, Istanbul’s new mayor welcomed the change to Hagia Sophia’s status. “In my heart it was a mosque since 1453,” he confessed. (Under his watch, Istanbul municipality recently acquired a portrait of Sultan Mehmet II at a Christie’s auction for $954K.) Almost all opposition leaders nodded approvingly.

Globally, it’s a different story. Except for low-level spokespersons of Hamas and the Muslim Brotherhood, the decision hasn’t received much international acclaim. Perhaps it fulfilled a desire that would be politically much more profitable if it remained unfulfilled. In intending to polarise Turkey’s opposition, the government ended up unifying it —a reaction, one might argue, of divine wisdom.