ISTANBUL — A Turkish court opened the way on Friday for Hagia Sophia to be restored as a mosque, threatening to set off an international furor around a World Heritage Site cherished by Christians and Muslims alike for its religious significance, stunning structure and as a symbol of conquest.
Originally built in the sixth century as a cathedral, Hagia Sophia stands as the greatest example of Byzantine Christian architecture in the world. But in its long history, it has been a source of Christian-Muslim rivalry, having stood at the center of Christendom for nearly a millennium and then of the Muslim Ottoman Empire after being conquered.
For the last 80 years it has been a museum, open to all, a monument of relative harmony and a symbol of the secularism that was part of the foundation of the modern Turkish state.
The court’s decision announced on Friday revokes that museum status and would allow Hagia Sophia to become a working mosque once again. It was a decision long sought by conservative Muslims in Turkey and beyond and especially by President Recep Tayyip Erdogan, whose popularity is waning after 18 years atop Turkish politics.
Opponents say his push to make the change is aimed at stirring his nationalist and religious base by glorifying Ottoman history and stepping back from Turkey’s nearly century-long devotion to secularism.
It was not immediately clear how the ruling would change life around the monument. Cevdet Yilmaz, spokesman for Mr. Erdogan’s Justice and Development Party, known as the A.K.P., said the government would determine how to carry out the change.
Mr. Erdogan is expected to make the final decision and may choose to hold prayers only on ceremonial occasions, as he did to mark the anniversary of the Ottoman conquest of the city in May. But his supporters may demand freedom to enter the building for daily prayers.
That would potentially open up all kinds of complications, not least ticketing, since all visitors currently have to pay an entrance fee — a big money earner for the city, but something worshipers are likely to object to.
Conservationists and art historians have raised concerns about what will happen to the medieval mosaics inside Hagia Sophia, which depict the Holy Family and portraits of imperial Christian emperors, which strict Muslims may demand be covered. Tour guides said that the building may be closed to tourists during prayer times, or even that parts of the building be sectioned off to non-Muslims.
A.K.P. party officials suggested holding the first Muslim prayers in Hagia Sophia (or Ayasofya by its Turkish name) on July 15 to mark the anniversary of a failed coup attempt in 2016 against Mr. Erdogan and his government, during a discussion about the change of status in June, the Turkish daily, Hurriyet, reported.
The court decision came as the culmination of a four-year campaign by an obscure cultural association that made legal applications to restore a number of monuments, including several Byzantine churches, as mosques. Hagia Sophia will be the fourth Byzantine church museum to be restored as a mosque under Mr. Erdogan. In November, the famous Chora monastery church in Istanbul had its status as a museum revoked.
When the plan for Hagia Sophia was floated, it met a chorus of dismay from religious and political leaders around the world. The ecumenical patriarch of Constantinople, Bartholomew, who is the spiritual leader of the Eastern Orthodox Church from his seat in Istanbul, said the conversion of Hagia Sophia into a mosque would disappoint millions of Christians around the world and divide Muslims and Christians since it had long been a place of worship for both.
Hagia Sophia, famous for the grandeur of its immense and iconic dome, was converted into a mosque in 1453 after Mehmed II the Conqueror held his first Friday prayers there, three days after seizing control of what was then the city of Constantinople.
Under the secular republic of modern Turkey, the monument was turned into a museum in 1934. It was named a masterpiece of the World Heritage site in Istanbul and has become Turkey’s most popular tourist attraction, drawing 3.7 million visitors last year.
Mr. Erdogan had voiced his intention to convert Hagia Sophia into a mosque several times. In May, he gave a strong indication that he would follow through on the plan when — remotely, because of the coronavirus — he opened a ceremony to commemorate the 567th anniversary of the conquest of Istanbul. An imam recited a verse from the Quran, known as the Conquest surah, celebrating the Treaty of Hudaibiyah between the people of Mecca and Medina.
The idea of converting Hagia Sophia back into a mosque prompted immediate pushback from Greece, which sees itself as the heir to the Byzantine Empire. The Greek Foreign Ministry denounced the conversion as unacceptable and a breach of Hagia Sophia’s status as part of a UNESCO World Heritage site.
In a statement Friday UNESCO said that Hagia Sophia is inscribed on its world heritage list as a museum which binds the Turkish state to ensure that “no modification is made to the outstanding universal value of the property.”
Presidential spokesman, Ibrahim Kalin, said Hagia Sophia could be a working mosque and be open to visitors in the same way that Notre Dame cathedral and the Sacre Coeur basilica in France hold services and are open to tourists.
“The opening of Hagia Sophia for worship does not prevent local or foreign tourists from visiting the place,” he said.
The change of status would also not affect the World Heritage status of the historic peninsula which encompasses the Ottoman Topkapi Palace, and ancient hippodrome and the Blue Mosque, he added.
“Opening this place to worship will not make Hagia Sophia lose anything from its world heritage identity,” he said in an interview with Anadolu Agency. “People can keep going there and visit the place. As our ancestors protected the Christian icons there, they will continue to be protected.”
But supporters of the move were increasingly triumphant on social media.
Finance Minister Berat Albayrak, who is also son-in-law to Mr. Erdogan, tweeted a phrase from a well known conservative nationalist poet:
“As master Necip Fazil Kisakurek said 55 years ago: ‘Wait, youngsters. Either today or tomorrow, Hagia Sophia will be opened.’”
Huseyin Gulerce, a pro-government columnist for the Star newspaper reprinted a column he had written 30 years ago in which he had criticized the conversion of Hagia Sophia into a museum as an unnecessary gesture of deference to the West that cast a “dark shadow” over Turkish independence.
“We want back what already belonged to us,” Mr. Gulerce wrote. “We want back what was cut off from our history, faith, culture, national dignity, state honor.”
“The hesitations of ‘But what would the United States, the West say?’ should be removed over this country,” he wrote then. “If you open Hagia Sophia you would make our dignified nation happy.’’