Before the construction of the Juma Mosque on this site, the ancient pagans performed rituals to the glory of the God of Fire. Russian academician A. Pavlinov, conducting measurements of the building came to the conclusion about the possible presence of a temple here in 1899. Then the fire-worshippers were displaced by the Muslims who inhabited these lands at the beginning of the last millennium. Temples and minarets have been repeatedly subjected to fires and destruction from natural disasters. After that, they were patiently restored every time. About the earliest restoration carried out by the architect Emir Sharaf al-Din Mahmud in 1309, says the preserved tablet.
The building we see today is not an original building. In the XVII century, it was completely destroyed due to natural conditions. The new building was erected by order of the ruler – Shah Abbas I.There is a legend that this mosque has not been preserved, allegedly, it burned to the ground in a fire. However, these data are not confirmed.
In 1899, the patron Haji Sheikhali Dadashev carried out a complete renovation of the shrine at his own expense. As a thank you, he was buried in a mosque. You can find the place where he rests by the carved tombstone.
In accordance with the traditions of medieval architecture, the mosque is based on an uneven hexagon with cut corners. The facade and columns are decorated with patterns of wood and stone. The elegant interior decoration corresponds to modern canons. On the vaults you can see tiles and ornaments made of rare decorative materials. The walls, painted in pastel tones, are covered with quotations from the Koran, inscribed with the help of a typical Arabic script.