Located in Kemeraltı Bazaar, Kestanepazari Mosque was built in 1663 and, like other mosques constructed in the 17th century, originally stood by the seaside. In fact, Evliya Çelebi mentions in his Seyahatname that the sea used to surround the right and left of the mosque at the time, but these areas filled up and became land over time. As the inner harbor silted up, the mosque lost its connection to the sea. The patron of the mosque was Hacı Ahmet Ağa, the superintendent of Baruthane-i Amire (Imperial Gunpowder Factory), and for this reason, it is referred to as Ahmet Ağa Mosque (Ahmet Ağa Camii) in Seyahatname. However, no historical sources provide information on when it began to be called Kestanepazarı Mosque. Like Şadırvan(altı) Mosque and Başdurak Mosque, Kestanepazarı Mosque is also a fevkani mosque. At the mosque’s ground floor, there are shops and storage spaces that continue to be used today.