Almost at the "Topkapi" edge of the Hagia Sophia, a few tens of meters before the gate to the Carpet Museum, there is an entrance to what turned out to be a mosque. On one occasion I saw the door was opened, and when I met someone attending I asked if I could take some pictures. I gather it is a small mosque, or at least a prayer room, probably for people working at the complex.
Istanbul Mosque within Hagia Sophia december 2015 5498.jpg
Istanbul december 2009 6677.jpg
Istanbul Aya Sofya October 2016 9188.jpg
Istanbul Aya Sofya October 2016 9189.jpg
Istanbul Mosque within Hagia Sophia december 2015 5499.jpg
Istanbul Mosque within Hagia Sophia december 2015 5500.jpg
Istanbul Mosque within Hagia Sophia december 2015 5501.jpg
Istanbul Mosque within Hagia Sophia december 2015 5502.jpg
Istanbul Mosque within Hagia Sophia december 2015 5508.jpg
Istanbul Mosque within Hagia Sophia december 2015 5504.jpg
Istanbul Mosque within Hagia Sophia december 2015 5505.jpg
Istanbul Mosque within Hagia Sophia december 2015 5506.jpg
Istanbul Mosque within Hagia Sophia december 2015 5507.jpg
Istanbul Mosque within Hagia Sophia december 2015 5503.jpg