The Hagia Sophia is the third and final church built on this site by the Byzantine emperors. The first two churches, dating from 360 and 415, were partly wooden and were burnt during civil disturbances. A few weeks after the second one was destroyed, emperor Justinian II ordered the construction of the Hagia Sophia on the same site. It was completed in 537, and it has weathered earthquakes, war, pestilence and famine ever since. Construction employed 10,000 people and took five years. The original dome of the church collapsed in 558 as a result of the third earthquake to strike the building. A new dome of improved design and construction was completed in 562, and it has survived to the present.