Shamakhi Juma Mosque: From 743 to the 2013 Rebuild

We read WhatsApp 09:00–21:00, Baku time. We reply in English, Russian and Azerbaijani.

Essentials

Type Landmark
Distance from Baku 123 km

The Juma Mosque stands in the centre of Shamakhi, a former capital west of Baku. The tourism board calls it the first mosque in Azerbaijan. What you see today is a 2013 rebuild of a mosque first raised in 743.

We wrote this page from the Azerbaijan Tourism Board and the President’s official website. The second carries a long account of the mosque’s history, read out at its reopening in 2013. We read both on 16 October 2026.

This page is about the mosque alone. Our Shamakhi guide covers the rest of the town and its surroundings.

The mosque at a glance

  • Founded: 743.
  • Rank: the oldest mosque in Azerbaijan and the second oldest in the Caucasus, says the tourism board.
  • Reopened: 17 May 2013, after works that began in March 2010.
  • Grounds: almost one hectare in total.
  • Minarets: 36.4 m tall.
  • Prayer hall: room for 1,500 people at once.

Why 743 matters

Shamakhi was once the capital of the Shirvanshahs, the tourism board says. The account read at the 2013 opening goes further back. It says the mosque was built in 743, in the time of Khalid ibn Valiyad. It marked the arrival of his brother, Muslim ibn Valiyad, in Azerbaijan.

The same account adds a story told “according to some sources”. A Khazar khan, beaten by the Caliphate’s armies, accepted Islam in this mosque. In his 2013 speech the President said the mosque played a huge role in spreading Islam in Azerbaijan and the Caucasus.

A town of earthquakes

Shamakhi sits in a seismic zone, and its history shows it. The tourism board records a terrible earthquake in 1192, when the city was the Shirvanshahs’ capital.

The quake of 1859 was worse for the mosque. The official account says it wiped the city off the map. After it, the centre of the province moved to Baku. A Shamakhi man, Gasim Bay Hajibababayov, was given the job of restoring the mosque.

1902 and an unfinished plan

Another earthquake hit in 1902. Here the official texts do not agree. The account read at the opening says the mosque stood up to it. The President’s speech says much of it was destroyed in 1859 and in 1902.

Either way, a rebuild on the old foundation followed. The architect Zivarbay Ahmadbayov led it first. Then the Polish engineer and architect Joseph Ploshko took over. His design was never finished. The account says the mosque kept its grandeur even so.

1918 and the Soviet years

In March 1918 the mosque burned. The tourism board speaks of inter-ethnic clashes that year. The account at the opening says people of Shamakhi had taken shelter inside, and gives 1,700 dead. The President’s speech said more than a thousand.

In Soviet times the building did not work as a mosque. It was repaired in 1980 at Heydar Aliyev’s initiative, the account says. Digs in the courtyard in the 1970s and 1980s found madrasas, cells and tombs. These were kept in their original form.

The rebuild of 2010 to 2013

President Ilham Aliyev visited in November 2009 and signed a decision to restore the mosque. Orders in December 2009 and February 2013 paid for it. Work began in March 2010, as part of a Heydar Aliyev Foundation project.

Builders followed the traditions of the Shirvan school of architecture. Because of the earthquakes, the foundation was reinforced with concrete. The President said the main aim was to keep the historic columns and walls.

What you will see

The entrance, the large central dome and the domes to its left and right were redone with old-style ornament. The middle hall is in the national style. The official account singles out the corridor for its design.

The courtyard was landscaped, with two pools and six galleries. The old cells around the mosque were restored. The Seyid Azim Shirvani Park next door was reshaped too.

Behind the prayer hall

The complex also has working parts most visitors never enter:

Building Size or use
Office building Two floors, 804 m²
Service building 520 m², with a 250-seat hall for rites
Kitchen Modern equipment, in the service building
Library Set up during the rebuild

Visiting

This is a working mosque again, and it reopened on a Friday. If you only want to look, avoid the Friday midday prayer. No official page sets out visitor hours, dress rules or a ticket. For the usual manners in a mosque, see our page on praying while travelling.

The tourism board lists spring, summer and autumn as the peak seasons in Shamakhi.

Getting there

Shamakhi is 123 km from Baku. A private transfer takes you to the town centre, where the mosque stands. Across the valley, the tourism board says, Yeddi Gunbaz holds the tombs of Shamakhi’s last independent rulers. It makes a good second stop.

Arranging it

Tell us the day you want to go and whether you plan to pray at the mosque. We will time the drive around the prayer hours that matter to you, and add the tombs or a winery if you like.

Tours and transfers

Common questions

How old is the Shamakhi Juma Mosque?

The first mosque was built in 743. The tourism board calls it the oldest mosque in Azerbaijan and the second oldest in the Caucasus.

Is the building I see the original?

No. The mosque has been rebuilt several times. The present building is the result of works from 2010 that ended with its opening in May 2013.

Were the old walls kept?

The President said at the 2013 opening that the main aim was to keep the historic columns and walls, with new parts added.

How tall are the minarets?

36.4 metres, according to the account given at the 2013 opening.

How many people can pray here at once?

1,500 in the prayer hall, by the same official account.

Is it a working mosque?

Yes. It reopened for worship on 17 May 2013, a Friday. It had not served as a mosque in Soviet times.

What are the opening hours?

No official page we read on 16 October 2026 gives hours for visitors. Ask us and we will check for your date.

How far is it from Baku?

Shamakhi is 123 km from Baku by our route figures, so the mosque fits a day trip.

A day trip, an overnight route, a transfer, or a custom itinerary? Tell us and we will plan it.