The Mashtagha Juma Mosque was built in 1708. Its prayer hall covers an area of 340 square metres. A dome, 3.5 metres in diameter and with eight windows, rests on 20 stone pillars connected at the top via arches. The original minaret was destroyed during Soviet times. A new one rises 46 metres high. Stone inscriptions remain on the mosque’s outside gallery.
Russian traveller Ilya Berezin visited Mashtagha shortly after an earthquake had shattered some of the villages near Baku in 1841. Shocked at the sight, he wrote in his diary: “The eye rejoices, the heart aches.“ Another earthquake had happened in this area some 80 years earlier. The people had just begun to get settled back into their normal lives when the new disaster struck. The only fortunate aspect is that a dull underground rumble had persisted for 10 days, warning the villagers of the strong tremors to come, so they had had enough time to flee and avoid casualties. The Russian traveller also notes the mosque that had barely survived the shocks.
Dozens of ancient mosques, including the Juma Mosque, have been damaged and rebuilt many times in Mashtaga. In this regard, the present appearance of the Friday Mosque does not fully reflect the centuries-old history. However, stone books, documents, and historical facts confirm that these places were mosques in ancient times.
According to Mashtaga intellectuals, by the end of the 30s of the last century, there were about forty mosques in the village. There were even mosques built during the Safavid period. The stone book of the 1414 Mosque of the "Artugay Mosque" is currently in the Museum of History of Azerbaijan.