I was reading the Wikipedia article on Basil the bulgar slayer and came across this line from the section on Fatimid wars,
In 987–988, a seven-year truce with the Fatimids was signed; it stipulated an exchange of prisoners, the recognition of the Byzantine emperor as protector of Christians under Fatimid rule and of the Fatimid Caliph as protector of Muslims under Byzantine control, and the replacement of the name of the Abbasid caliph with that of the Fatimid caliph in the Friday prayer in the mosque at Constantinople.
I would love some details on the existence of this mosque. Were the Byzantines really this tolerant? Was there a sizeable Muslim population living in Constantinople? Etc.
Thanks.
The quick, simple answer to your question is "yes". This being askhistorians, however, we should dive a bit deeper, shouldn't we? Let's go.
I want to tackle your last question first, tho, by saying that the presence of non orthodox people and communities in Constantinople needs not to be seen under a frame of tolerance vs intolerance but under one of geopolitics and commerce. Constantinople, during its really long history as the seat of the emperors of the Romans was one of the biggest, most internationally connected cities in the world. Its economic and political projection reached from Scandinavia, where the personal guard of the Emperor came from, to Ethiopia; from beyond the shores of the Volga to the Iberian Peninsula, where the biggest and most important Caliphal Mosque in Córdoba had its mihrab decorated with Roman mosaics made by Roman constantinopolitan artisans.
In terms of urban infrastructure the city was host to at least half a million people during certain periods. Thus, the physical presence of such a diverse host of diplomatic and economic actors in such a big urban scale required the existence of physical spaces for those communities to practice their functions and live their lifes. Constantinople ended up developing "colonies", neighbors/ areas inside the city destined for specific communities, a practice that the Ottomans maintained, exemplified in the contemporary different districts of Old Jerusalem. The most famous of these colonies / neighborhoods (albeit not inside the old city) was Pera, the Genoese Quarter, still called Pera to this day. If you were to visit Constantinople somewhere around the time of the Crusades you could have seen Armenian, Venetian, Pisan, Bulgarian, Russian and, yes, Muslim communities. I want to reiterate that this is not a consequence of Tolerance but of both geopolitical power and imperial Ecumenical discourse. It was not a matter of moral, it was a matter of power. When constantinopolitan politics dictated, both the government and/or the people acted in ways we would portray as extremely intolerant, such as the infamous massacre of the Latins. Riots against ethnic minorities in Constantinople are attested from those against the Isaurians back in the V century, which serves us to remark both the metropolitan nature of Constantinople since late antiquity (there needs to exist a sizable minority present for it to be prosecuted in the first placs) and how the question is definitely not one framed in moral dilemmas. A given Emperor could present a seaside palace to a princely zoroastrian "host" in the morning and order the punishment of fellow Christians for extremely specific theological disagreements in the afternoon. Both were political issues, not moral ones. In terms of organized religious violence Constantinopolitan Rome was way more focused on eradicating chistian heresy that eradicating other religions, specially the religions of states Romans considered geopolitical equals, such as those under the rule of a Zoroastrian Sha or a Muslim Caliph. Just to recap, tolerance is not an useful tool to frame this question.
Having clarified that, let's look at the matter of the Mosque itself. We have no archeological remains, and textual proof is disperse and non specific, but we know there were at least two physical spaces for Muslim people to so specific stuff in the city. One of them covered a diplomatic role, the other one covered a comercial role. It is important to understand that these were not mosques per se, but physical spaces where worship spaces were available.
The first mention of a "mosque" (referred to as magisdion in greek) in Constantinople is found in Constantine VII's De Administrando Imperio. Constantine places its construction in the context of early caliphal raids to Constantinople and the need to host high ranking caliphal officials for ransom and diplomacy. Muslim authors actually refer to the space as Dar Al-Balat, Dar being a word used for oficial government spaces in contrast to religious, usually translated as Palace. Dar Al-Balat might have started as a kind of golden prison for elite muslim enemies, but by the time of Basil II we see the concept of "the Mosque of Constantinople" being used in diplomacy. There is no direct proof of this mosque being the Dar Al-Balat, but it is very likely given its location inside the Great Palace complex. Treaties like the one signed by Basil stipulated the decoration of the Mosque and the maintenance of a muezzin. This diplomatic act became an tool in later times. For instance, in 1049 Empress Theodora decided to allow the khutba (the pledge of allegiance to the Caliph said during Friday prayer) to be directed to the Seljuk Tughril Beg instead of the Fatimid Caliph with a clear geopolitical motivations. The Fatimids reacted by seizing the treasures of the Church of the Sepulchre in Jerusalem, showing how it was an important matter of geopolitical prestige in the Muslim world by then.
The second physical place in Constantinople wich we could refer to as a "mosque" is most famous for the role it had in the enormously destructive fire caused by the Latins during the 4th Crusade, wich was started by the pillaging of a non defended "mosque" near the shore of the Golden Horn. The place was officially called the synagogue of the Agarenes, but ir was popularly known as Mitaton. The location and nature of the place is still discussed, but it is tought to be a palatial complex meant to be the center of Syrian silk traders in the city. As such it had different functions, and worshipping was certainly one of them. Anyway, the violence displayed by the Latins during the assault on the civilian unprotected Muslims there created a fire that ended up destroying huge swaths of the old city.
I am sadly away from my computer and books so excuse my poor editing and style. If you want to read more about this spaces, here's a very interesting article full of sources: https://www.researchgate.net/publication/233680754_Islamic_Spaces_and_Diplomacy_in_Constantinople_Tenth_to_Thirteenth_Centuries_CE
The most present secondary source in the article is Stephen w. reinert's late byzantine and early ottoman studies.
In addition to u/anchaescastilla's answer, I recently answered How were Muslims and other minorities (such as Jewish people and Catholics) treated in the Byzantine Empire?, which also has a little bit of info about the mosques.