It was consecrated in 360, during the reign of Emperor Constantius II. It was built next to the Great Palace, the principal imperial residence.
This church had a wooden ceiling, columns and an entrance facing west. Unfortunately, it burned down in 404 CE. Temple was rebuilt in 415 CE and then was destroyed again in 532 CE.
It was then that Emperor Justinian instructed two Greek specialists, the architect Isidore of Miletus and the engineer and mathematician Antemius of Tralles to design and begin the church's construction. The emperor himself is said to have taken an active part in the planning of the church.