Contrary to its monumental presence today, Hagia Sophia wasn't always grand. The first two versions, built in the 4th and 5th centuries, were wooden structures destroyed by riots. Emperor Justinian I in the 6th century commissioned the third and iconic version, featuring the groundbreaking, large-scale dome that reigned supreme for nearly a millennium.