Throughout the centuries Justinian's masterpiece has undergone many changes including earthquakes, sacking by foreign armies, conversion to Islamic usage and finally its conversion to a museum. The amazing survival of Hagia Sophia is due to the love and care of centuries of believers who have made it a home of prayer, history and art.