Several thousand people including Turkish President Recep Tayyip Erdogan have participated in the first Muslim prayers at Hagia Sophia since the controversial reconversion of the former cathedral into a mosque.
The prayers come after a 10 July ruling revoked the Byzantine-era building's status as a museum, in place since 1934.
Mr Erdogan recited a verse from the Koran before the call to prayer was heard from the four minarets of Hagia Sophia.
It served as a Christian Byzantine cathedral for 900 years before it was seized by Ottoman conquerors and converted to a mosque.
Muslims prayed there until 1934 when it was turned into a museum.
Hagia Sophia is nearly 1,500 years old and was one of the most exalted seats of Christian and then Muslim worship in the world, meaning that the change to its status has profound repercussions for followers of both faiths.
It is also a UNESCO World Heritage Site.
Here are the key facts of Hagia Sophia's history, the campaign to change its status, and statements by religious and political leaders following its conversion to a mosque.
Hagia Sophia, or 'Divine Wisdom' in Greek, was completed in 537 by Byzantine emperor Justinian.
The vast, domed structure overlooked the Golden Horn harbor and entrance to the Bosphorus from the heart of Constantinople.
It was the centre of Orthodox Christianity and remained the world's largest church for centuries.
Hagia Sophia stayed under Byzantine control - except for a brief seizure by Crusaders in the 13th century - until the city was captured by the Muslim forces of the Ottoman Sultan, Mehmet the Conqueror, who converted it into a mosque.
The Ottomans built four minarets, covered Hagia Sophia's Christian icons and luminous gold mosaics, and installed huge black panels embellished with the names of God, the prophet Mohammad and Muslim caliphs in Arabic calligraphy.
In 1934 Turkey's first president, Mustafa Kemal Ataturk, forging a secular republic out of the defeated Ottoman Empire, converted Hagia Sophia into a museum, now visited by millions of tourists every year.
In July 2020, a Turkish court annulled its museum status, paving the way for Mr Erdogan to designate it a mosque.
Its Christian frescoes and glittering mosaics adorning the dome and central hall will be concealed during Muslim prayer times, but remain on display at other times.
A Turkish association which was committed to making Hagia Sophia a mosque again pressed Turkish courts several times in the last 15 years to annul Ataturk's decree.
In the latest campaign, it told Turkey's top court that Ataturk's government did not have the right to overrule the wishes of Sultan Mehmet - even suggesting that the president's signature on the document was forged.
That argument was based on a discrepancy in Ataturk's signature on the edict, passed around the same time that he assumed his surname, from his signature on subsequent documents.
Mr Erdogan, who has championed Islam and religious observance during his 17-year rule, supported the Hagia Sophia campaign, saying Muslims should be able to pray there again and raised the issue - which is popular with many pious AKP-voting Turks -during local elections last year.
Turkish pollster Metropoll found that 44% of respondents believe Hagia Sophia was put on the agenda to divert voters' attention from Turkey's economic woes.
Outside Turkey, the change has raised alarm and despair, but Turkey has said what Turkish people want is of most importance.
- Ecumenical Patriarch Bartholomew, spiritual head of 300 million Orthodox Christians, said altering the status of Hagia Sophia would fracture Eastern and Western worlds.
- In neighbouring Greece, an overwhelmingly Orthodox country, Prime Minister Kyriakos Mitsotakis said: "This is a choice which offends all those who also recognise the monument as a World Heritage Site."
- A spokesman for the US State Department said the United States was disappointed by the decision but looked forward to hearing Turkey's plans for continued stewardship of the Hagia Sophia to ensure it remains accessible to all.