Something similar happened to Chora, near Edirnekapı, which also kicked off as a church before becoming the Kariye Camii (mosque) in the early 16th century. It too is now a museum and makes a wonderful showcase for the mosaics and frescoes of 14th century Byzantium.
Aya Sofya and the Chora Museum feature on most tourist itineraries. Visitors to Topkapı Sarayı will also walk past Hagia Eirene, the Church of Divine Peace, which was built in 537 at about the same time as Hagia Sophia. This church is used as an atmospheric concert hall during İstanbul music festivals but is not otherwise open to the public, which is a great shame. However, dotted about the historic peninsula of Old İstanbul, there are several other buildings that started life as Byzantine churches before acquiring a new Islamic identity after the conquest. Fascinating places, they are at the same time living features of the city as it is now and poignant reminders of what it was in the past, and once you know what you're looking for, it's not hard to pick them out since most look pretty similar: their central domes standing proud above red brick walls with at least one apse indicating where the altar would once have stood.
For most visitors, the easiest to find of the other church-mosques is the one known as Küçük Aya Sofya (Little Aya Sofya), which is just a short walk downhill from the Blue Mosque. Küçük Aya Sofya started life as the church of Sts. Sergius and Bacchus and was commissioned by the Emperor Justinian in 527, five years before work began on the much larger Hagia Sophia. Its rather plain outside gives no hint at the beauty of the interior where a two-story colonnade runs round an octagonal hall beneath an exquisite dome. The columns still retain their beautifully carved Byzantine capitals, some of them still showing off the initials of Justinian and his wife Theodora. Sergius and Bacchus, Roman soldiers who had been martyred for espousing Christianity, were said to have appeared to the Emperor Anastasius in a dream, pleading for Justinian, who faced execution for plotting against him, hence his enthusiasm for building a church in their honor as soon as he succeeded to the throne.
Church of Sts. Sergius, Bacchus
In the 16th century, the Church of Sts. Sergius and Bacchus was converted into a mosque and acquired not just a minaret but also a courtyard with cells opening off it which now serve as craft workshops. Recently the mosque was comprehensively restored. Opinions vary as to the end result.
Küçük Aya Sofya still functions as a mosque, but another of the city's great Byzantine churches, the Theotokos Pammakaristos, better known as the Fethiye Cami, has been subdivided so that one side can be used for mosque services while the other is a museum. This gem of a building deserves to receive many more visitors than currently cross its threshold. It appears to have started life in the 12th century as the Church of the Joyous Mother of God but had a side chapel added in the 14th century. This was embellished with mosaics that are only less impressive than those in the Chora Museum because there are fewer of them; the Pantocrator in the dome, for example, is breathtakingly beautiful and completely intact. To find it, you need walk only a short distance from the Chora Museum. What's more, you pay just a third of the Chora admission fee to view it.
Of the other church-mosques dotted about Old İstanbul, the most important must be what is now the Zeyrek Camii but which started life as the Church of the Pantocrator in the early 12th century. Zeyrek Camii has a magnificent location on a bluff overlooking the Golden Horn. However, until recently it stood in a very poor neighborhood and was in an advanced state of dereliction, its magnificent mosaic floor hidden away beneath shabby carpets. All that is about to change, though, as the entire complex of two churches and a chapel is currently undergoing restoration. Once the covers come off, hopefully by the start of next year, the Zeyrek Camii is likely to scoop up far more visitors.
The city's other church-mosques tend to be more neglected. Take the Church of Constantine Lips (otherwise known as Fenari İsa Camii), for example. Dating back in part to the 10th century, this is one of the oldest religious structures to survive in the city, and stands right beside busy Vatan Caddesi, but how many people ever pause to look at it and wonder at its complicated history, let alone hang around until prayer time in the hope of sneaking a look inside? The cute little Church of the Myrelaion (a.k.a. Bodrum Camii) also dates back to the 10th century and can be found tucked away in the back streets of Laleli amid the cheap clothing emporia. Most people walk straight past it without giving it a second glance.
You'll need to hunt a bit harder to track down the Gül Camii (Rose Mosque) in Cibali. This probably started life in the 10th century as the Church of St. Theodosia whose feast day was May 29, the very day on which it became obvious that Constantinople would not be able to hold out against the forces of Sultan Mehmet the Conqueror. In their fear, the city's inhabitants flocked to the church and filled it with roses as they prayed to the saint for salvation. When the Ottomans rode up to the church, they found the flowers still in place, hence the name they gave to the building when they converted it into a mosque.
A short walk deeper into the Zeyrek backstreets should bring you to the slightly smaller 11th century Church of St. Savior Pantepotes (Christ the All Seeing). This was used as a soup kitchen during the years when Fatih Cami was being built, hence its name, the Eski İmaret Camii (the Old Soup Kitchen Mosque). If you press on into Vefa, you should be able to find a mosque that actually acknowledges its heritage in its name; the Kilise Camii (Church Mosque) seems to have started life between the 10th and 12th centuries as the Church of St. Theodore, but probably acquired the mosaics in its narthex during the 14th century since they bear some resemblance to those in the Chora Museum. The façade of the building incorporates many fragments of Byzantine marble, which makes it well worth a look even if you don't manage to get inside. Finally, if you continue walking into the Süleymaniye area, you should eventually stumble upon, right up against the old aqueduct, the late 12th century Church of the Theotokas Kyriotissa (Holy Mother of God), which went on to become the Kalenderhane Camii, its name commemorating the fact that it was used as a tekke (lodge) by Kalender dervishes. The walls of the church were once covered with frescoes showing the life of St. Francis of Assisi. These have, however, been removed to the Archeological Museum, where sadly they are not currently on display.