Many of the architectural monuments of Baku were built on the ruins of very old buildings belonging to the pagan period in the history of Azerbaijan. Thus, according to archaeologists, the Maiden Tower is built on the site of a pagan temple. The basement of Sabail castle also contains some fragments of the older buildings. Juma mosque in the Icheri-sheher can also be listed among such monuments.
Mosque in the Icheri-sheher has been functioning since the 12th century. This mosque was built in 1899 at the funds of Baku philanthropist Khadja Shikhali Dadashev. In 1888 the Russian academician A.Pavlinov took measurements of the Juma Mosque. The mosque was built on the site of the temple of fire worshipers. Only four uncoated arches remained from the old building, they allegedly belonged to the temple. According to many modern archaeologists, there was a pagan sacred center on the site of Juma Mosque, where the fire worshipers gathered.
In the 14th century pagan temple was converted into a mosque. According to the inscription on the Mosque, "in the month of Rajab in the year 709 Hijri (1309) Amir Sharaf al-Din Mahmud ordered to update this mosque." In the 15th century, minaret was attached to the north side of the Mosque. By the end of the 19th century the old mosque came into disrepair and was replaced by a new one - Juma Mosque.
Juma mosque itself is small. There is little hall for men, women's prayer rooms. The conical dome of the building, which rests on four pillars located in the center of the Juma Mosque ,is of special interest.