There are various monumental buildings of ancient and medieval period on the territory of the old Baku, but among them the group of monuments consisting of mosques and madrasahs is particularly notable. The oldest of them were built on the site of pagan sacred centers: churches and temples, but also, there are monuments of a later period, such as Molla Ahmed Mosque, Lezgi Mosque and Mirza Ahmed Mosque, which were built at the expense of wealthy men and the rich patrons of Baku.
Molla Ahmad Mosque is a quarter mosque in Icheri sheher. It was built in the 14th century by order of Nasir al-Din Gushtasb. The mosque was designed by the famous medieval architect Mahmud ibn Sad. The mosque was named after the cleric Mullah Ahmed, so the name became popular. The mosque has a shape of an irregular quadrangle. The Arabic inscription on the dome of the building narrates the history of the mosque construction.
Haji Mirza Ahmed Mosque is another quarter mosque in Icheri sheher fortress. It was built in 1345. Its convenient location near the residential quarters of the Old City has made this mosque one of the most visited mosques in the medieval period. The building itself, like most of the mosques in Baku, is rectangular in shape. The mosque building consists of a square vestibule, several rooms for prayer, as well as back rooms. It has been suggested that the mosque was built on the foundations of ancient buildings.
In 1169 Najaf Ashur Ibrahim oglu built a mosque, which we now know under the name Lezgi Mosque. Like many other buildings of Icheri sheher, Lezgi Mosque was built on more ancient foundations, the fact based on the results of many archaeological excavations. Under the southern part of the mosque there were found two arches from some ancient building, probably a pagan temple. When in the 19th century the workers from Dagestan started coming to Baku, the mosque was given to Lezghins so that they prayed and performed their rites there. Lezgi mosque is shaped like a parallelepiped, but since it is not a very large mosque, there is only one prayer hall.
Mosques in old Baku are distinguished with simple architecture and magnificent design. Many of them are still functioning nowadays as an integral part of Old Baku.