On 537 AD, Christians completed the 3rd Hagia Sophia on the same ground as the 2 previous Hagia Sophia basilicas. After the sacking of Constantinople by Ottoman Turks in 1204, the basilica was converted into a mosque and imagery banned by the Muslims was then painted over with plaster frescoes.
In this shot you can see a little of both.
Currently restorers are painstakingly trying to reveal more of the mosaics while trying to strike a balance between Muslim and Christian representation.
The Hagia Sophia is far and away one of the coolest man made structures that I have ever seen and definitely a must see for any visit to Istanbul.