Daily · 09:00 – 19:30
The mosaic of Constantine and Justinian presenting the city and the church to the Virgin and Child.
All guides

The Complete History of Hagia Sophia: From 537 to Today

Fifteen centuries in one building: Justinian, the Fourth Crusade, Mehmed II, the museum decades and the 2024 visitor route.

History · Last reviewed 6 September 2026

The history of Hagia Sophia spans nearly fifteen centuries and reflects the shifting power, faith and identity of Constantinople and later Istanbul. From its dramatic construction in the sixth century to its present role as both mosque and major visitor site, it has continually adapted while remaining one of the world’s most significant buildings.

Construction and the age of Justinian, 532–537

The building we know today rose from the ashes of political violence. In January 532 the Nika Riots devastated Constantinople and destroyed the earlier church on the site, which had itself replaced a fourth-century structure. Emperor Justinian I seized the opportunity to create a monument that would proclaim the power and piety of his reign.

He entrusted the project to two brilliant scientists and architects, Anthemius of Tralles and Isidore of Miletus. Construction began almost immediately and proceeded with extraordinary speed. On 27 December 537 the new church was consecrated. Justinian is said to have declared, on entering the finished building, “Solomon, I have outdone thee.”

The scale was unprecedented. The central dome, approximately 31 metres across and rising more than 55 metres above the floor, seemed to float on light. A sophisticated system of pendentives, semi-domes and buttressing distributed its immense weight. For nearly a thousand years Hagia Sophia remained the largest cathedral in the world and the architectural embodiment of the Byzantine Empire at its height.

The Byzantine era, 537–1453

Throughout the Byzantine centuries Hagia Sophia served as the patriarchal cathedral of Constantinople and the ceremonial heart of the empire. Emperors were crowned here, major religious festivals were celebrated, and the liturgy unfolded beneath the great dome in a carefully choreographed display of imperial and ecclesiastical power.

The building did not remain static. Earthquakes caused partial collapses of the dome in 558, 989 and 1346, each followed by reconstruction that slightly altered its profile. During the Iconoclastic period of the eighth and ninth centuries many figurative images were destroyed or covered; after the restoration of icons in 843, new mosaics were gradually added, including the apse image of the Virgin and Child and later imperial portraits.

The Fourth Crusade brought catastrophe. In 1204 Latin crusaders sacked Constantinople and converted Hagia Sophia into a Roman Catholic cathedral. Many treasures were looted and the building suffered neglect. When Byzantine rule was restored in 1261 the church returned to Orthodox use, but the empire was by then greatly weakened. Despite repairs and the continued beauty of its mosaics, Hagia Sophia entered the final Byzantine centuries as a symbol of a diminished but still proud capital.

The Ottoman era, 1453–1934

On 29 May 1453 Constantinople fell to the Ottoman forces of Sultan Mehmed II. Within days the sultan ordered Hagia Sophia converted into a mosque. The Christian furnishings were removed and a mihrab was installed indicating the direction of Mecca. A wooden minaret was erected, and over the following decades and centuries additional minarets of stone were added by later sultans, including the distinctive pair built by the great architect Mimar Sinan.

Hagia Sophia became the principal imperial mosque of the Ottoman capital. Sultans attended Friday prayers here and the building received successive layers of Islamic decoration. Large calligraphic roundels bearing the names of Allah, the Prophet Muhammad and the early caliphs were eventually installed. In the mid-nineteenth century, under Sultan Abdülmecid I, the Swiss-Italian Fossati brothers carried out a major restoration that strengthened the structure, cleaned the mosaics — many of which were then covered again — and renewed the interior decoration.

For nearly five hundred years Hagia Sophia functioned as a living mosque at the centre of Ottoman religious and political life, while still preserving beneath its Islamic furnishings the architectural skeleton of Justinian’s great church.

From the Republic to the present

After the founding of the Turkish Republic the status of Hagia Sophia changed once more. In 1934 a decree of the Council of Ministers, associated with the secularising reforms of Mustafa Kemal Atatürk, converted the building into a museum. The carpets were lifted, many mosaics were uncovered and restored, and Hagia Sophia became a monument open to visitors of all backgrounds, celebrated as a shared heritage of humanity.

This museum phase lasted until 2020. In July of that year a presidential decree reconverted Hagia Sophia into a mosque. The building returned to active Muslim worship while remaining open to visitors outside prayer times. From 2024 a formal ticketing system was introduced for foreign tourists: the upper gallery became the designated visitor route with a paid entrance, while the ground floor continued to serve primarily as a prayer space.

Today Hagia Sophia stands as both a functioning mosque and one of Istanbul’s most visited historic sites. Its architecture still proclaims the ambition of Justinian, its mosaics preserve the artistic legacy of Byzantium, and its minarets and calligraphy mark centuries of Ottoman use.

A living monument

The complete history of Hagia Sophia is not a simple sequence of religious conversions. It is the story of a single structure that has continually absorbed new meanings while retaining its extraordinary spatial power. From the consecration of 537 through Byzantine imperial ceremony, Ottoman Friday prayers, the museum decades of the twentieth century and its present dual role, Hagia Sophia has remained a place where architecture, faith and history intersect with unusual intensity. Standing inside it today, visitors encounter all of these layers at once.

Ready to choose a date?

Availability for the Visitor Gallery is shown per date, and the conditions on this page apply to every one of them.

View tickets
TicketsHagia Sophia Tickets 2026: Entry Rules and What’s Included