Hagia Sophia is a basilica and planned patriarchal cathedral built by Justinian I between the years 532 and 537 in the old part of Istanbul.
It was converted into a mosque by Fatih Sultan Mehmet after Istanbul was taken by the Ottomans in 1453. In 1935 when it was converted into a museum some of the plaster was removed and the Christian mosaics were again brought to light.
Today’s Hagia Sophia building is known as the "Third Hagia Sophia" since it is actually the third church built on the same spot. The first two churches were destroyed during the riots.
The central dome of Hagia Sophia, which was the widest dome of its period, collapsed many times during the Byzantine period but it has never collapsed since Mimar Sinan, the chief Ottoman architect during the 16th century (for sultans Suleiman the Magnificent, Selim II, and Murad III) added retaining walls to the building.