It was this church which Constantine built between 326 and 330 CE, on the site of an earlier temple to Aphrodite, no less, in which the Mass was held dedicating and consecrating his new city of Constantinople (named, incidentally - New Rome, officially but rarely, if ever called that) to the Glory of God. Until the building of the Hagia Sophia during the reign of Justinian, two hundred years later, this church served as the main patriarchal church of the city.
The second Ecumenical Council of Constantinople was held here in 381. During the reign of Justinian - who despite his adherence to, and support of, Christianity, also had not a few faults - the Nika riots broke out between the Blues and the Greens and he had the Janissaries put the riots down with a ferocious blood-letting massacre in the Hippodrome. Had it not been for his fearless and somewhat domineering and ambitious wife, Theodora, he may well have decided that discretion was the better part of valour, resigned or even worse - escaped ignominiously. (For an absolutely scintillating and hilarious commentary on the character and personality of Theodora, you can do no better than read Byzantium, Vol I. by John Julius Norwich). Nevertheless, for all her unproven, lurid history, Theodora it was who saved the day; she would have none of her husband's vacillating and insisting on him remaining and facing the mob down - which, in the end he did. However, before this the mob had managed to destroy much of Constantinople including the Hagia Sophia and - the Hagia Eirene. It was rebuilt and again destroyed by earthquake in 740 (in 748/9 there was a devastating earthquake in the Holy Land, one of the worst ever also doing great damage), following which Constantine V rebuilt it.