Several marble blocks from the second church survive to the present; among them are reliefs depicting 12 lambs representing the 12 apostles. Further digging was forsaken for fear of impinging on the integrity of the building.
Originally part of a monumental front entrance, they now reside in an excavation pit adjacent to the museum's entrance after they were discovered in 1935 beneath the western courtyard by A. On 23 February 532, only a few weeks after the destruction of the second basilica, Emperor Justinian I decided to build a third and entirely different basilica, larger and more majestic than its predecessors.
Earthquakes in August 553 and on 14 December 557 caused cracks in the main dome and eastern half-dome.
The main dome collapsed completely during a subsequent earthquake on 7 May 558, This reconstruction, giving the church its present 6th-century form, was completed in 562.
Columns and other marbles were brought from all over the empire, throughout the Mediterranean.
The idea of these columns being spoils from cities such as Rome and Ephesus is a later invention. This new church was contemporaneously recognized as a major work of architecture.
In 1453, Constantinople was conquered by the Ottoman Empire under Mehmed the Conqueror, who ordered this main church of Orthodox Christianity converted into a mosque.
Although some parts of the city of Constantinople were falling into disrepair, the cathedral was maintained with an amount of money set aside for this purpose.
The nearby Hagia Eirene ("Holy Peace") church was completed earlier and served as cathedral until the Great Church was completed.
Both churches acted together as the principal churches of the Byzantine Empire.
The Patriarch of Constantinople John Chrysostom came into a conflict with Empress Aelia Eudoxia, wife of the emperor Arcadius, and was sent into exile on 20 June 404.