No other building has had such a huge effect on the architecture of both the eastern and western worlds as Hagia Sophia (literally, the Church of the Holy Wisdom), in present day Istanbul. It's dome is actually set on a square base; this is achieved by means of what are called pendentives, which transferred the weight of the dome to the four corners. This is a style of building which has influenced architecture for centuries.
The history of the building is fascinating. The site was originally occupied by a pagan temple in the city, which was originally known as Byzantium, but then Constaninople after the founder of the city, Constantine the Great. He was a bit ambivalent about his religious beliefs; initially a pagan (he was Pontifex Maximus, the high priest of the ancient Roman religion) and he initially viewed Christ as just another god of war.
He didn't exactly lead a blameless life, however, and he gradually converted to Christianity, allegedlybelieving that this would wash his (many) sins away. Before his death he ordered that a Christian church be built on the site of the pagan one. This was eventually consecrated by his son Constantius, in 360, and was known as The Great Church.
The Christian church in those days was just finding it's feet and there were many disputes over the nature of Christ. (was he human? Divine? Partly human and partly divine? Wholly human, and simultaneously wholly divine? And was he just the Son of God, or His (everyone assumed God was male) equal? Nowaday many of us would ignore theological questions like these but the Byzantines took them very seriously indeed; wars, and massacres, regularly took place between followers of one form or another. Relationships between the Emperor (or Basilius) and the top church dignitories was often precarious.
Following a dispute involving a deposed patriarchate of Constantinople and the current empress this church was burned down during a riot and was subsequently rebuilt in 1415.
By 525, new riots were simmering in the city. The spark this time was said to be enmity between the followers of two teams of charioteers, the Blues and the Greens. On the 13th January The so-called Nika riots broke out over the proposed execution of ringleaders of both factions; and new fires were started, which resulted in the chrch being burned down again.
The Emperor, Justinian, contemplated running away but his wife Theodora was said to have disuaded him. He soon had revenge on the mob; during a race meeting at the Hippodrome his soldiers entered and it was claimed that they butchered everyone in there, followers of Greens and Blues alike. In all more than 30,000 people were said to have died.
Not surprisingly, they never rioted again. On the 23rd February Justinian ordered the building of the new church which survives to this day, although it has now been transformed into a mosque.
By 537 the new basilic was inaugorated. It was breathtakingly magnificent; at the time the greatest enclosed space in the world. The walls were covered in mosaics , some themselves covered in gold leaf, and windows set into the dome gave a heavenly light. Unfortunately though that dome had been built a lettle flatter than had been intended, and during an earthquake it collapsed. Justinian immediately ordered a rebuild; the dome was made more circular, with a ribbed construction over pendentives, a design which has survived to this day.
Over the centuries the church suffered desecration by iconoclasts, people who opposed religious symbols; hacking off of valuable metals, including gold leaf, by an army of crusaders; and then conversion into a mosque when the city was conquered by the sultan Mehmet the Second in 1453. For a while it became a museum between 1934 and 2020, and then it became a mosque again, much to the fury of millions of people throughout the world. The story of Hagia Sophia is, though, not over yet!