Little Hagia Sophia Mosque was originally constructed as a church located between the Cankurtaran and Kadırga Neighborhoods of the Eminönü District by the Byzantine Emperor Justinian I (527-565). The mosque, built in the year 530 CE, called the Church of Sts. Sergius and Bacchus, was converted into a mosque during the reign of Sultan Bayezit II after the conquest of Istanbul by Darüssaade Ağası (overseer of the sultan’s harem), Hüseyin Ağa. After its convertion into a mosque, the zaviye (cell for meditation) around the atrium and Hüseyin Ağa’s tomb were built.
The domed mosque, composed solely of stone and brick atop a square plan, was damaged by an earthquake twice during the years 1648 and 1763. Reparations followed in 1831. Furthermore, the nearby railway constructed in1860 has impaired further construction to a large extent. In addition, it is thought that the old minaret of the mosque was erected in Baroque style after the second half of the 18th century. However, it was later pulled down for an unknown reason in 1936, and the existing minaret was added to the mosque in 1955. The octagonal historical marble fountain in the atrium was later removed in 1938.