Exactly it doesn’t known for which reasons used this strange place and when it was constructed. Probabyly used as a temple during reign of Tiberius II or the crypt of a former castle that was associated with the Castle of Galata. Here was the place where one end of the colossal chain extended to other side of Golden Horn to blockade unwanted ships entering to the Golden Horn. Some parts of this chain are on display in the Military museum in Harbiye. According to rumors during the first Arab seige of the Constantinople, some of the martyred soldiers was burried here. When Arap army turned back to Damascus important belongins of soldiers was burried here and then they were sealed, because of that it is also known as the Kursunlu Mahzen Camii (Gunpowder Warehouse Mosque). Inside the mosque can be seen a tomb and two graves of sainted martys killed during the first Cosntantinople siege. The location of these graves was revealed to a Naksibendi dervis in a dream in 1640. Then Murat IV constructed a shrine on the site. Later in 1757, the whole cellar was converted into a mosque by Kose Mustafa Pasa.
The mosque has six rows of nine, totally 54 squat pillars with a low vaulted ceiling. After an eartquake the tower shaped minaret was destroyed then was build by Mahmut I.
Underground Mosque on Google Maps