Juma Mosque of Shamakhi: history, three halls, and how to visit
Shamakhi · about 1.5 to 2 hours from Baku
The Juma Mosque of Shamakhi is a working Friday mosque in northern Azerbaijan, founded in 743 to 744 AD under the Umayyads. The oldest mosque in Azerbaijan and among the oldest in the Caucasus, it has an unusual plan of three connected prayer halls with three mihrabs and three entrances. Wrecked by earthquakes in 1859 and 1902, the present building is a 2010 to 2013 reconstruction on the ancient footprint.

Photo: Diego Delso, CC BY-SA 4.0, via Wikimedia Commons
- Region
- Shamakhi
- From Baku
- 120 km · about 1.5 to 2 hours
- Best season
- Spring to autumn
- Time to spend
- About 30 minutes
- Entry
- An active mosque; free to visit, with modest dress required.
- Three connected prayer halls, each with its own mihrab and entrance, the mosque's signature plan
- Rebuilt Shirvan-style domes and a tall minaret over old Shamakhi
- An 8th-century foundation date that makes it the oldest mosque in Azerbaijan
- A quiet courtyard setting in the historic Shirvan capital, an easy stop on the road to Sheki
Most people meet the Juma Mosque on the road west, two hours out of Baku, on the way to Sheki. Shamakhi was the capital of the medieval Shirvan state, and this Friday mosque is the reason many travellers stop. The story is older than the building: an 8th-century foundation, a run of earthquakes, and a careful rebuild that finished only in 2013. Here is what stands there now and why it matters.
How old is the Juma Mosque of Shamakhi?
The mosque was founded in 743 to 744 AD, during the Umayyad period, which makes it the oldest in Azerbaijan. That foundation date is well attested, even if the exact patron is debated, so it is fairer to say "founded in the 740s under the Umayyads" than to attach a single name. Almost none of the 8th-century fabric survives above ground. What you walk into today is essentially a reconstruction, completed between 2010 and 2013 on the same footprint the mosque has held for nearly thirteen centuries.
Is it the oldest mosque in the Caucasus?
Not quite. It is the oldest in Azerbaijan but the second oldest in the wider Caucasus. The Juma Mosque of Derbent, in present-day Dagestan just north of the border, dates to 734 AD and beats Shamakhi by about a decade. Plenty of tourist copy calls Shamakhi "the oldest in the Caucasus," but that title belongs to Derbent. Shamakhi is still one of the earliest mosques in the region by any measure, and being the oldest in the country is distinction enough.
What does the mosque look like, and what is special about it?
The signature feature is the plan: three connected prayer halls, each with its own mihrab (the niche pointing toward Mecca) and its own entrance. That three-part arrangement is rare in the Caucasus and is often compared to the early Umayyad mosques of Damascus. The rebuild gives you tall pointed domes in the Shirvan style and a slim minaret rising over the old town. The structure has been knocked down and raised again more than once, badly by the earthquakes of 1859 and 1902 that wrecked much of Shamakhi, yet each rebuild kept the original three-hall layout. A visit is short, around half an hour, which is why it works best as one stop on a longer day.
How do you get there from Baku, and what else is nearby?
Shamakhi sits about 120 km west of Baku, a drive of roughly 1.5 to 2 hours along the highway toward Sheki and Ganja. There is no convenient train, so a car or a guided trip is the practical way in. The mosque pairs naturally with two other Shamakhi sights: the Yeddi Gumbez, or Seven Domes, a hillside burial ground of the Shirvan khans where three domed tombs still stand, and the ruined Gulistan fortress on the heights above town. The district is also wine country, with vineyards on the surrounding slopes. On our 6-day Azerbaijan cultural tour, the mosque comes mid-route, on the same Shamakhi day as the cliff-set Diri Baba Mausoleum at Maraza, before the long pull toward Sheki.
Can you go inside, and what should you wear?
Yes. It is a working Friday mosque, free to enter, and visitors are welcome outside prayer times. Dress modestly. Women cover their hair, shoulders and knees, and a light scarf is enough; men should skip shorts. You take your shoes off before stepping onto the carpets, and you keep your voice down if anyone is at prayer. Photography of the interior is usually fine, but ask first if people are worshipping. Hours and any seasonal closures are best confirmed locally on the day you go.



- How old is the Juma Mosque of Shamakhi?
- It was founded in 743 to 744 AD, in the Umayyad period, which makes it the oldest mosque in Azerbaijan. The building you see today is not original, though. After earthquakes in 1859 and 1902 and a major rebuild finished in 2013, the present structure is a reconstruction on the ancient site.
- Is it the oldest mosque in the Caucasus?
- It is the oldest in Azerbaijan but the second oldest in the wider Caucasus. The Juma Mosque of Derbent, in present-day Russia, dates to 734 AD and predates it by about a decade. Shamakhi's mosque is still one of the region's earliest, founded only a few years later.
- What else is there to see in Shamakhi?
- Shamakhi pairs the Juma Mosque with the Yeddi Gumbez (Seven Domes), a hillside cemetery of the Shirvan khans where three domed tombs survive, and the ruins of the medieval Gulistan fortress above town. The wider district is also known for vineyards and winemaking. A half-day covers the main sights.
- How far is the Juma Mosque from Baku?
- Shamakhi is about 120 km west of Baku, roughly a 1.5 to 2 hour drive on the road toward Sheki and Ganja. There is no direct rail link, so most visitors arrive by car or on a guided trip. The mosque sits in the old part of town.
- Can tourists go inside the mosque?
- Yes. It is an active Friday mosque, free to enter, and visitors are welcome outside prayer times. Dress modestly: women cover their hair, shoulders and knees, and men avoid shorts. Remove your shoes before stepping onto the carpets, and keep noise down if people are praying.
- Why does it have three prayer halls?
- The three-hall plan is the mosque's defining feature and unusual for the region. Three connected prayer rooms each carry their own mihrab and entrance, an arrangement often compared to the early Umayyad mosques of Damascus. Successive rebuilds after earthquakes kept this original layout intact.