IZMIR, Turkey — President Recep Tayyip Erdogan of Turkey on Friday issued a decree ordering the Hagia Sophia, a majestic 65,000-square-foot stone structure from the sixth century in Istanbul, to be opened for Muslim prayers. The same day, a top Turkish court had revoked the 1934 decree by Mustafa Kemal Ataturk, the founder of the Turkish republic, which had turned it into a museum.
The Hagia Sophia was built as a cathedral and converted into a mosque, and then a museum. It has for centuries been the object of fierce civilizational rivalry between the Ottoman and Orthodox worlds.
The reconversion of the Hagia Sophia into a mosque was an old dream of Turkey’s Islamists. In the Islamist political tradition of President Erdogan and his Justice and Development Party, Ataturk’s experiment in secular republican government was a foreign imposition on Turkey, and the Hagia Sophia’s status as a museum a seal on the country’s spirit.
After making the announcement, according to one report, Mr. Erdogan was so shaken with emotion that he did not sleep until first light the next morning. What he thought of as an era of humiliation had ended.
After 1950, when the Kemalist regime held the country’s first free elections, its political enemies began to organize. Ataturk had died more than a decade before, and the power of his memory was gradually waning.
Sections of Islamist and pan-Turkic romanticists began campaigning for the reopening of the Hagia Sophia. They believed that the secular republic, far from having saved Turkey’s sovereignty, wounded it in the deepest sense possible: It had sold its soul to Western modernity. The conversion of the Hagia Sophia was the symbol of this humiliation.
The most articulate expression of this view was delivered by Necip Fazil Kisakurek, Turkey’s most prominent Islamist poet and polemicist of the time, on Dec. 29, 1965, at a conference on the Hagia Sophia. Mr. Kisakurek said the decision to convert the structure into a museum was to “put the Turks’ essential spirit inside a museum.”
Referring to Ataturk’s cabinet as a “clique,” Mr. Kisakurek accused them of committing an act of unspeakable self-harm. “What the Western world has made us do inside, through its agents among us, neither Crusaders, nor the Moskof [the Soviets] nor the Hagia Sophia’s salacious coveters, the Greeks, have been able to do,” he said.
The poet said in that 1965 speech that the opening of the Hagia Sophia was a question of time. “It shall be opened in such a way that all lost meaning, like the bloodied and chained innocent, shall emerge from it weeping, in tatters,” he said. “It shall be opened in such a way that in its cellars shall be found the files of the evil ones who were thought to have done the nation good, and the good ones who were thought to have done it evil.”
The dome of the Hagia Sophia was erected by Emperor Justinian in the sixth century as the central cathedral of Byzantium, or the Eastern Roman Empire. In 1453, the Ottomans launched a spectacular siege on the capital city of Constantinople and consummated their victory by converting the Hagia Sophia, its main cathedral, into a mosque, as was customary at the time.
It was this moment of reversal — from Christian to Muslim — that fired imaginations across Europe and the Middle East. Many dreamed of a day of reckoning as the Ottoman Empire unraveled in the 18th and 19th centuries. In the World War I, Istanbul was occupied by British, French, Italian and Greek forces, but even then, Muslims did not give up the Hagia Sophia. When a group of Greeks wanted to enter the building and install a cathedral bell, Ottoman soldiers drove them away by threatening to blow up the entire structure.
Turkish forces fought off the allied invaders under the leadership of a rebellious Ottoman field marshal, Mustafa Kemal (later Ataturk), who went on to rebuild modern Turkey. During his single-party rule, Ataturk abolished the sultanate and set up a secular republic, enacting reforms to westernize the country by decree.
There are various myths about the reasons behind Ataturk’s decision to convert the Hagia Sophia into a museum in 1934. What is certain is that he decided after convening with Thomas Whittemore, a visiting American scholar of Byzantium, and was interested in restoring the structure’s mosaics. Ataturk seemed to have wanted to move the country past the medieval concepts of myth and holy conquest.
When Mr. Kisakurek, the powerful Islamist poet, raised the rallying cry for the reconversion of the Hagia Sophia into a mosque in 1965, it is likely that Recep Tayyip Erdogan, an 11-year-old boy in the working-class, religious neighborhood of Kasimpasa near the Golden Horn in Istanbul, would have heard the poet’s call.
He would also have heard how even Nihal Atsiz, a writer who advocated a pan-Turkic identity over that of the Islamists, revered the Hagia Sophia and thought its status a humiliation. And the young Erdogan might even have heard how Nazim Hikmet, the great poet of the socialists, devoted stanzas to the Hagia Sophia’s spirit in his youth.
As Turkey’s prime minister between 2003 to 2014 and as the country’s president, Mr. Erdogan has gradually dismantled all checks on his power and shifted the country’s political center of gravity in his favor. The idea was always that opening the Hagia Sophia for prayers would mark the maturation of Islamist power and cement its gains. Do it too soon, however, and it could backfire, just as Ataturk’s conversion had.
When Mr. Erdogan addressed Turkey on July 10 after the court’s judgment, he cited Mr. Kisakurek’s 1965 Hagia Sophia Conference and cited the other poets as well. The Turkish president wanted the entire nation, not just the Islamists, to make the spiritual journey with him.
In this address to the nation, Mr. Erdogan did not mention Ataturk by name. He did not have to. He quoted at length Mehmet the Conqueror’s will, which states that whoever changes the status of the Hagia Sophia “has committed the most grave sin of all” and that “the curse of God, the Prophet, the angels and all rulers and all Muslims shall forever be upon him. May their suffering not lighten, may none look at their face on the day of Hajj.”
Various authorities of the Greek and Russian Orthodox churches voiced their indignation, and the pope expressed “profound sadness.” The governments of the European Union and the United States muttered their regrets. There are also Christian extremists who care deeply about the Hagia Sophia and its symbolism. These sentiments make the decision all the more exciting to many Turks.
The first prayer at the Hagia Sophia mosque will take place on July 24, the anniversary of the Treaty of Laussane, signed between the Allied powers and Turkey, which drew the boundaries of modern Turkey. Mr. Erdogan will want the Western world especially to watch closely, because the ceremony will represent what he considers the reclamation of Turkish sovereignty from its clutches.
What comes out of the Hagia Sophia’s gates today is a spirit that sees itself as inherently good and its chosen enemies as inherently evil. It is the spirit of revenge, and it has catching up to do.