The work on the new and third Hagia Sophia began on February 23, 532 A.D., and it was consecrated after it was completed on December 27, 537 with a solemn mass (Kahler, pg. 9). But this was not the first church named Hagia Sophia. The first emperor in Byzantine history was Constantine. He legalized Christianity in 330, and eventually moved the entire seat of the Roman Empire to Byzantium, a city by the sea at the edge of both the European Continent and the Asian Continent. He renamed this city after himself calling it Constantinople.
According to art historians the first church was probably built as early as 326. It was known as “the Great Church” and was also called “Hagia Sophia” in “honor of Christ, the Wisdom of God. Both these names were used throughout the history of the church (Mathews, pg. 11). Mathews writes that the historians speak of it as being, “shaped like a circus,” and it was probably a “timber-roofed basilica” (Mathews, p. 12). A fire broke out in 404, and the Old Hagia Sophia and a nearby senate building burned down, not completely destroyed, but what remained was simply covered over. A second church named both Megale Ekklesia and also Hagia Sophia was built by Emperor Theodosius in 415. This second Hagia Sophia also burned down in just over 100 years in the famed Nika riots of January 532 in protest to Emperor Justinian. The Emperor had come to power that very year, and the newest Hagia Sophia was begun just 39 days later, and then celebrated for its luxuriousness and opulence. Justinian wanted to build a church like none before it, and he did.