Justinian's great church of 537, an imperial mosque from 1453, a museum from 1934 and a working mosque again since 2020 — what you can see and how a visit works today.
Last reviewed on 27 September 2026.
Hagia Sophia — Ayasofya in Turkish, "Holy Wisdom" in Greek — stands at the north end of Sultanahmet Square, facing the Blue Mosque across a garden and backing onto the outer walls of Topkapı Palace. For almost a thousand years it was the largest church in Christendom and the ceremonial heart of the Byzantine Empire; for nearly five centuries after that it was the premier imperial mosque of the Ottoman capital. This page covers its history, its architecture and mosaics, and — because it has changed considerably since 2020 — how a visit actually works now. For the city as a whole, start with the Istanbul overview or the Istanbul sights hub.
The building you see is the third church of that name on the spot. The first, a timber-roofed basilica, was dedicated in 360 under Constantius II, son of Constantine the Great. It burned in 404 during riots that followed the exile of the patriarch John Chrysostom. Theodosius II replaced it with a second basilica, dedicated in 415. That one was destroyed in January 532 in the Nika riots, when rival chariot-racing factions from the nearby Hippodrome turned on the emperor Justinian and set much of the city centre alight.
Pieces of the Theodosian church survive. Just in front of the present west entrance, below the modern ground level, you can see excavated steps, column fragments and a carved frieze of lambs — symbols of the apostles — from the portico of the 415 building.
Justinian began rebuilding within weeks of the riots. His architects, Anthemius of Tralles and Isidore of Miletus, were mathematicians and engineers rather than masons by training, and they produced something with no real precedent: a vast central dome carried on four great arches, with half-domes to east and west extending the space into a long nave. The transition from the square below to the circular dome above is made by pendentives — curved triangular sections of masonry — used here on a scale nobody had attempted. The church was dedicated on 27 December 537, less than six years after work started. A later tradition, recorded centuries afterwards, has Justinian exclaiming that he had outdone Solomon; it is a good story but not a contemporary source.
The first dome was shallower than the present one and partly collapsed after earthquakes in 558. Isidore the Younger, nephew of the original architect, rebuilt it higher and more steeply curved, and the church was rededicated in 562. Further partial collapses followed in 989 and 1346, each repaired, which is why the dome today is not perfectly regular. It measures roughly 31 metres across and rises about 55 metres above the floor. The ring of forty windows at its base is what produces the famous effect, described by Justinian's court historian Procopius, of a dome that seems to float on light rather than rest on stone.
For nine centuries the church was where emperors were crowned, where imperial processions ended and where the patriarch of Constantinople presided. It was sacked by the armies of the Fourth Crusade in 1204, and served as a Latin Catholic cathedral until the Byzantines retook the city in 1261. A marker in the upper gallery traditionally identifies the grave of Enrico Dandolo, the Venetian doge who led it.
When Constantinople fell to Mehmed II on 29 May 1453, the sultan went to Hagia Sophia and ordered it converted into a mosque; Friday prayers were held there within days. The Ottomans added a mihrab oriented towards Mecca (which is why it sits slightly off the building's axis), a minbar, a sultan's lodge and, over time, the four minarets. In the 16th century the architect Sinan strengthened the structure with heavy buttresses and designed the minarets' final form, and the tombs of several sultans, including Selim II and Murad III, were built in the grounds.
The Byzantine figurative mosaics were not destroyed wholesale. Some were plastered or painted over, gradually and in stages rather than all at once; many remained visible for a long time after the conquest. The Swiss-Italian Fossati brothers, commissioned by Sultan Abdülmecid for a major restoration in 1847–49, recorded several mosaics before covering them again. The eight huge wooden roundels bearing the names of God, the Prophet Muhammad, the first four caliphs and the Prophet's grandsons Hasan and Hüseyin were hung during that restoration; the calligraphy is by Kazasker Mustafa İzzet Efendi.
In 1934 the government of the young Republic, under Atatürk, decided to turn Hagia Sophia into a museum, and it opened as one in 1935. Plaster was removed and the surviving mosaics were uncovered and studied, largely by the Byzantine Institute of America. For eighty-five years it was one of the most visited museums in the country.
In July 2020 the Council of State, Türkiye's highest administrative court, annulled the 1934 decision, and a presidential decree transferred the building to the Directorate of Religious Affairs (Diyanet). The first Friday prayers were held on 24 July 2020. Its official name is now the Ayasofya-i Kebir Camii Şerifi, the Great Mosque of Hagia Sophia. The reconversion was welcomed by many in Türkiye as the restoration of Mehmed II's foundation and criticised by UNESCO, several governments and Orthodox Christian churches, which argued that a World Heritage monument of shared significance should have stayed a museum. Whatever view one takes, the practical result for visitors is that this is now a working mosque that tourists may enter, not a museum.
The arrangements have changed several times since 2020, so treat what follows as a description of the current system rather than a guarantee.
The upper galleries were originally where the empress and court women watched the liturgy, and they hold several of the best-preserved mosaics. The gallery route therefore still gives access to much of what made the museum famous, even if you cannot now stand under the dome on the ground floor.
In the south gallery, the Deësis ("supplication") panel shows Christ flanked by the Virgin Mary and John the Baptist, who plead with him on behalf of humanity at the Last Judgement. Its lower half is lost, but the faces that survive — especially the Baptist's, drawn with extraordinary tenderness — are considered among the finest works of Byzantine art. It is generally dated to the period after the Byzantine recovery of the city in 1261.
Also in the south gallery, two panels show emperors making offerings to Christ or the Virgin. In the Zoe panel, the empress Zoe and her husband Constantine IX Monomachos flank an enthroned Christ; the emperor's face and name were evidently altered at some point, and the usual explanation is that the image originally showed one of Zoe's earlier husbands. Beside it, the Komnenos panel shows John II Komnenos and his wife Irene, a Hungarian princess, with the Virgin and Child, with their son Alexios added on the adjoining pier.
Two celebrated mosaics are in the entrance zone. Above the Imperial Door, the central doorway from the inner narthex into the nave, an emperor — usually identified as Leo VI — kneels before an enthroned Christ. In the southwest vestibule, the Virgin and Child sit between Constantine, offering a model of the city, and Justinian, offering a model of Hagia Sophia. Whether these are visible on the current foreign-visitor route depends on how the route is arranged when you visit; the apse mosaic of the Virgin and Child, dedicated in 867 as the first figurative image installed after the period of iconoclasm, can be seen from above but at a distance.
Roughly 31 m across, carried on four pendentives and four great arches, with forty windows around its base. Rebuilt steeper in 562 after the first dome failed.
The heavy external masses are later additions, Byzantine and Ottoman, including Sinan's 16th-century work. They are why the exterior looks bulky compared with the airy interior.
Coloured marbles and porphyry from around the Mediterranean, including columns reused from older buildings, and walls once sheathed in gold mosaic.
Mihrab, minbar, the sultan's lodge, the müezzin platforms, the great calligraphic roundels and the four minarets, added between the 15th and 19th centuries.
From the gallery you can also pick out the omphalion, a square of inlaid circular stones in the floor where Byzantine emperors are traditionally said to have been crowned, and the two great marble lustration urns from Pergamon placed near the entrance in the 16th century.
The tombs of five Ottoman sultans, including Sinan's tomb for Selim II with fine İznik tilework, stand in the grounds on the south side; access has varied with recent building works. Hagia Irene and the Imperial Gate of Topkapı are two minutes' walk behind the building, and the 6th-century Basilica Cistern is across the street to the west.
It is a mosque. It served as a church from 537 to 1453, as a mosque from 1453 to 1934 and as a museum from 1935 to 2020. Since July 2020 it has again been a working mosque, run by the Directorate of Religious Affairs, which tourists may visit outside prayer times.
Since 2024 foreign visitors have used a separate route to the upper galleries, for which an entrance fee is charged. Worshippers and Turkish citizens enter free through the prayer entrance. The fee has changed since it was introduced, so check the current amount before you go.
Yes, many of them. The foreign-visitor route runs through the upper galleries, where the Deësis and the imperial panels of Zoe and of John II Komnenos are located. Some figurative images facing the prayer hall, such as the apse Virgin and Child, may be veiled during prayers.
Women should cover their hair with a scarf and wear long sleeves and an ankle-length skirt or loose trousers. Men should wear long trousers and a shirt covering the shoulders. Shoes are removed before the carpeted areas.
The visitor route closes for a period around each of the five daily prayers and for longer around the Friday midday prayer. Prayer times shift through the year, so look up the day's times for Istanbul and plan to arrive soon after a prayer has ended.
The present building was commissioned by the Byzantine emperor Justinian I after the Nika riots of 532 destroyed the previous church. His architects were Anthemius of Tralles and Isidore of Miletus, and it was dedicated in December 537. The dome was rebuilt by Isidore the Younger after a collapse in 558.