This oldest and largest mosque in Azerbaijan, Shamakhi Djuma, according to the legend was built in the 8th century when Shamakhi was chosen as residence by an Arabian caliph. The initial Arabian inscription on the portal of the mosque said that the mosque had constructed in 744. Therefore Shamakhi Djuma is considered as one of the earliest mosques of Transcaucasia. The composition of Shamakhi Djuma has no analogues in Azerbaijan. The architecture of the building is as follows - the huge hall for prayers is divided into three independent sections connected by open wide doorways.
Each part has its separate mikhrab and an entrance. Many people call this mosque a three-hall. After significant destructions caused to the mosque during wars and earthquakes it has been repeatedly reconstructed and restored. Its contemporary condition was formed in the early 20th century. The mosque was practically built up anew on the old foundation without losing main principles of its structure. It still has three halls. Besides, the central hall is covered by a huge dome, the other two by smaller domes. There is a windows belt running under the central dome. The windows are decorated by tracery lattices. The entire facade is decorated with ornamental decor.
Built more than 1,200 years ago Shamakhi Djuma mosque still remains one of the largest cult structures of the Caucasus.