The Hagia Sophia was the place where the coronation of the Emperors was performed because of the Imperial Church in the Eastern Roman Period. For this reason, a rounded and interlaced patterned floor covering (omphalion) from the colored stones on the right side of the main place (naos) in Hagia Sophia is the section where the Eastern Roman Emperors were crowned. IV. During the Crusade, Istanbul was occupied by Latinos between 1204 and 1261 and during this period both the city and the Hagia Sophia were looted. When the eastern Roman city was recovered in 1261, it was known that Hagia Sophia was in a very ruined state. Hagia Sophia, Fatih Sultan Mehmed (1451-1481) in 1453 conquered Istanbul was converted into a mosque. Immediately after the conquest, the structure was strengthened and preserved as a mosque with the addition of the Ottoman Period. The structure, which was damaged by various earthquakes since the date of its construction, was built in support of both Eastern Roman and Ottoman periods. The minarets built by Mimar Sinan also serve as supporting supports in the building.

A madrasa was built to the north of Hagia Sophia, during the reign of Fatih Sultan Mehmed Period, and the most extensive repair work was carried out by Fossati during the reign of Sultan Abd¸lmecid (1839-1861). During the reorganization of the Hagia Sophia in the period of Sultan Abdulaziz, the madrasah was demolished between 1869 and 1870 and rebuilt between 1873 and 1874. The ruins of the madrasah, which was destroyed in 1936, were unearthed during the excavations in 1982.