Excerpts from Books and Wikipedia
"Within a few days of witnessing its predecessor burned to the ground in the riots of January 532, Justinian had ordered the construction of a new basilica, the third to stand on the site since Constantine's original foundation in 325. . . . For more than 900 years, Hagia Sophia served as the seat of the Patriarch of Constantinople and the visible center of Orthodox Christianity. However, it suffered damage by earthquake and was stripped of its treasures by the army of the Fourth Crusade in 1204. When Constantinople fell to the Ottoman Turks in 1453, Sultan Mehmed II ordered the building to be turned into a mosque and four minarets were added, giving it the familiar outline it has today. In 1935, it was turned into a museum by the secular Turkish government, and remains so to this day." [1001 Days]