Turkish President Recep Tayyip Erdogan joined thousands Friday in the first Muslim prayers in Hagia Sophia since the Istanbul landmark was converted back into a mosque.
Massive crowds gathered inside and outside the Unesco World Heritage site, some draped in Turkish flags and others waving Islamic banners. Erdogan put their number at 350,000.
Inside the mosque, the faithful, wearing protective face masks, took photos as they waited for prayers to begin.
As the call to prayer reverberated from the Hagia Sophia's four minarets, huge crowds spread prayer mats on the lawns outside.
Inside, the president recited a verse from the Qur'an. In a sermon, the head of the state religious affairs agency, Ali Erbas, said the reopening "is the return of a sacred place, which had embraced believers for five centuries, to its original function."
Also in attendance was Erdogan's ally and leader of the ultranationalist MHP, Devlet Bahceli.
The Hagia Sophia was built as a cathedral during the Christian Byzantine Empire and converted into a mosque after the Ottoman conquest of Constantinople in 1453.
In 1934, modern Turkey's founder Mustafa Kemal Ataturk ordered it be turned into a museum.
But Turkey's highest administrative court, the Council of State, cancelled that decision earlier this month, arguing that the building had been registered as a mosque in its property deeds.
The timing of the first prayer is significant as it coincided with the 97th anniversary of the Treaty of Lausanne, which set modern Turkey's borders after years of conflict with Greece and Western powers.
Ankara has dismissed international criticism over the reconversion of Hagia Sophia to a mosque, and insisted that tourists — some 3.8mn last year — would still be able to visit the mosque and see its famous Byzantine mosaics.
The mosaics, plastered over for centuries when the building served as a mosque, will now be hidden by curtains during prayer times since Islam bans figurative representations.
For many Muslims, the reconversion is nevertheless a landmark event.
"We see this as the second conquest of Istanbul," said Selahattin Pamukcu, 33, who had come especially from the Aegean region of Izmir.
"This is the moment when Turkey breaks its chains. Now it can do whatever it wants, without having to submit to the West," added Selahattin Aydas from Germany.