Nestled in a dramatic mountain basin on the southeastern slopes of the Greater Caucasus some 120 kilometers west of Baku, the ancient city of Shamakhi reigned for centuries as the royal capital of the Shirvanshah dynasty and a vital emporium along the Silk Road crossing the Caucasus. Dominating the historic heart of this former royal capital stands the Juma Mosque of Shamakhi (written in standard Latin Azerbaijani as Samaxi Cume Mescidi, the Congregational Friday Mosque of Shamakhi), an imposing limestone sanctuary featuring a rhythmic arched portico facade, three grand domes patterned in turquoise geometry, and twin cylindrical minarets soaring more than 36 meters against the mountain sky.
Founded in 743 to 744 CE (the year 126 of the Islamic Hijri calendar) during the Umayyad Caliphate, the Juma Mosque of Shamakhi holds the distinction of being the oldest mosque in the Republic of Azerbaijan and the second oldest house of Islam in the entire Caucasus region (preceded only by the Juma Mosque of Derbent, founded in 733 to 734 CE). Across nearly thirteen hundred years, the sanctuary has four times been shattered by some of the most violent earthquakes recorded along the Caucasian tectonic fault (in 1192, 1656, 1859, and 1902) and scarred by wartime fire in March 1918. Yet after every catastrophe, the people of Shirvan and visionary architects including Qasim bey Hajibababeyov, Jozef Goslawski, and Ziver bey Ahmadbeyov (the creator of Taza Pir Mosque, Baku) raised the sanctuary anew from its eighth-century foundations, making it an enduring emblem of faith and architectural resilience alongside Bibi-Heybat Mosque, Baku.

IWorship of Almighty Allah, the First Congregational Friday Mosque of the South Caucasus, and the Medieval Madrasa
In accordance with strict Islamic monotheism (Tawhid), the Juma Mosque of Shamakhi is consecrated exclusively to the worship of Almighty Allah. The title Juma Masjid (Masjid al-Jumu'ah in Arabic, or Cume Mescidi in Azerbaijani) designates a Congregational Friday Mosque: unlike smaller neighborhood prayer houses used for the five daily prayers, a Juma Mosque serves as the principal civic and spiritual sanctuary of a major city or province, where the entire community of believers gathers at midday every Friday for collective prayer and the Friday sermon (Khutbah).
When Islam spread northward from the Arabian Peninsula into the South Caucasus during the eighth century under the Umayyad Caliphate, Shamakhi (already recorded in the second century CE by the Greco-Roman geographer Claudius Ptolemy under the name Kemakhiya or Mamakhiya in Caucasian Albania, a land where ancient fire veneration akin to Ateshgah Fire Temple, Baku had long existed) was selected as the strategic administrative and military center of the Shirvan region. Erecting the Juma Mosque at Shamakhi in 743 to 744 CE marked the permanent institutional establishment of Islamic civilization south of the Greater Caucasus range.
A remarkable liturgical and architectural feature of the Juma Mosque of Shamakhi is its tripartite interior layout consisting of three interconnected square prayer halls crowned by three separate domes, each hall possessing its own independent prayer niche (Mihrab) oriented toward the Qibla (the Sacred Kaaba in Mecca). Throughout the religious history of Shirvan, Shamakhi stood at the crossroads of both Sunni Islam (particularly the Shafi'i and Hanafi legal schools widespread in northern Azerbaijan and the Caucasus mountains) and Twelver Shia Islam (which flourished from the sixteenth-century Safavid era onward), as well as major Sufi mystical orders such as the Khalwatiyya and Hurufiyya traditions linked to the great fourteenth-century poet and mystic Imadaddin Nasimi, who was born in this very quarter of Shamakhi in 1369.
Dividing the forty-six-meter-long sanctuary into three communicating halls through wide pointed arches allowed different study circles, legal schools, or separate men's and women's sections to pray simultaneously on weekdays while uniting the entire expanse into a single congregational space on Fridays and feast days. This centuries-old spirit of inclusive worship at the Shamakhi Juma Mosque laid the historical groundwork for Azerbaijan's celebrated tradition of Unified Prayer (Vahdat Namazi) practiced today at Taza Pir Mosque, Baku.
Archaeological and epigraphic proof confirming the eighth-century foundation of the Shamakhi Juma Mosque came to light in 1902, when a scientific reconstruction commission led by the geologist and engineer Shahsuvarov cleared the fractured masonry walls after the devastating 1902 earthquake to inspect the bedrock foundations. While excavating the ancient lower courses of the central hall, researchers uncovered an Arabic foundation inscription recording that the mosque had been erected in the year 126 of the Islamic Hijri calendar (corresponding to 743 to 744 CE).
This date of 743 CE aligns precisely with early Arabic and Caucasian historical chronicles recounting the campaigns of the Umayyad prince and general Maslama ibn Abd al-Malik (often remembered in local Caucasian tradition as Abu Muslim) in Derbent and Shirvan. After fortifying the Caspian gates and founding the Juma Mosque of Derbent (733 to 734 CE), the Arab administration in Shirvan established the Juma Mosque of Shamakhi as the second great congregational sanctuary of the Caucasus.
Beyond its role as a house of prayer, throughout the golden age of the Shirvanshah state from the ninth to the sixteenth centuries, the Shamakhi Juma Mosque complex functioned as one of the premier Islamic university colleges (Madrasas) of the Caucasus. Flanking the spacious courtyard were vaulted student cells (hujras) and lecture rooms where scholars and students from across Shirvan, Persia, Central Asia, and Dagestan studied Quranic exegesis, Islamic jurisprudence (Fiqh), astronomy, medicine, and classical poetry. This vibrant intellectual milieu around the Juma Mosque nurtured many of Azerbaijan's greatest literary figures, including the twelfth-century court poet Khaqani Shirvani, the fourteenth-century philosophical poet Imadaddin Nasimi, and the nineteenth-century enlightenment educator and poet Seyid Azim Shirvani.
IIA 1,300-Year Odyssey Across Four Catastrophic Earthquakes, the Tragedy of March 1918, and the 2013 Restoration
Situated directly above one of the most active seismic fault zones on the southern flank of the Greater Caucasus, the history of Shamakhi and its Juma Mosque is an extraordinary testament to human perseverance: four times leveled by earthquakes that destroyed almost the entire city and once gutted by wartime fire, Azerbaijan's oldest mosque has repeatedly risen anew upon its sacred 743 CE foundations.
- 743 to 744 CE (126 AH)Foundation of the original Juma Mosque at Shamakhi during the Umayyad eraErected in 126 AH according to the ancient Arabic epigraphic tablet discovered in 1902, establishing the oldest Islamic sanctuary in Azerbaijan at the administrative heart of Shirvan.
- Late 12th Century (1192) and 17th Century (1656)Major reconstructions under the Shirvanshahs and Safavids following severe earthquakesAfter the catastrophic earthquake of 1192 (which prompted Shirvanshah Akhsitan I to transfer his royal residence to Baku), the Shamakhi Juma Mosque is rebuilt on a reinforced plan; following the 1656 earthquake during the Safavid period, the mosque and its courtyard Madrasa are restored and expanded.
- 1859 to 1860Post-earthquake reconstruction by architect Qasim bey HajibababeyovFollowing the December 2, 1859 earthquake that forced the Russian Imperial governorate capital to relocate from Shamakhi to Baku, the renowned Shirvan architect Qasim bey Hajibababeyov (1811 to 1874) restores the damaged mosque, whose medieval silhouette had been sketched in 1847 by Russian artist Grigory Gagarin.
- February 13, 1902 to 1909Monumental redesign by architects Ziver bey Ahmadbeyov and Jozef GoslawskiAfter the devastating magnitude 6.9 earthquake of February 13, 1902, a public reconstruction committee commissions Shamakhi native Ziver bey Ahmadbeyov and Baku chief architect Jozef Goslawski (1865 to 1904) to design a majestic triple-domed mosque with twin minarets upon the ancient foundations.
- March 1918 and the Soviet EraThe conflagration of March 1918 and seven decades of Soviet neglectDuring the bloody March Days of March 1918 in Shamakhi, armed Dashnak forces set fire to the Juma Mosque while hundreds of unarmed townspeople, women, and children are sheltering inside; scarred by fire, the incomplete building remains closed to worship throughout the Soviet period.
- December 2009 to May 17, 2013Comprehensive seismic reconstruction and restoration under the Heydar Aliyev FoundationBy presidential decree of December 2009 and within the Heydar Aliyev Foundation's Address of Tolerance project, the entire complex is reinforced against magnitude 9 earthquakes, its three domes and twin 36.4-meter minarets are completed to the 1902 design, and the mosque is solemnly reopened on May 17, 2013.
The creative partnership of Ziver bey Ahmadbeyov and Jozef Goslawski after the 1902 earthquake. When the terrible earthquake of February 13, 1902 leveled more than four thousand homes in Shamakhi and brought down the upper vaults of the Juma Mosque (leaving only sections of the thick stone walls and the eighth-century foundations standing), donations poured in from across the Caucasus. The young architect initially called upon to draft the restoration plan was none other than Shamakhi native Ziver bey Ahmadbeyov (1873 to 1925), who had just graduated in Saint Petersburg and would three years later design Taza Pir Mosque, Baku. Ahmadbeyov insisted on preserving the historic three-hall footprint and Shirvan architectural character of his hometown sanctuary.
To ensure maximum structural resilience against future earthquakes, the reconstruction committee also invited the brilliant Polish-born chief architect of Baku, Jozef Goslawski (1865 to 1904, celebrated designer of Baku City Hall and the Taghiyev Girls' School), working with civil engineer Kazimirsir. Blending Ahmadbeyov's mastery of Shirvan stone ornament with Goslawski's modern structural engineering and crown-like dome skylights, their joint project created the iconic silhouette of three domes and two soaring minarets. Although construction was tragically halted in March 1918 when the mosque was burned during the massacre of Shamakhi's civilian population (fire-blackened stones from March 1918 are still preserved on site as a memorial), the visionary 1902 design of Goslawski and Ahmadbeyov was finally brought to full, magnificent completion during the state restoration inaugurated on May 17, 2013.
IIIThe 46-Meter Tripartite Prayer Hall, Three Crowned Domes, Twin 36.4-Meter Minarets, and Historic Madrasa Cells
Unlike the compact cubic single-domed mosques typical of the Absheron Peninsula such as Taza Pir Mosque, Baku, the Juma Mosque of Shamakhi is built on an elongated rectangular plan stretching 46 meters from east to west and 28 meters from north to south, divided internally into three interconnected square prayer halls. This broad tripartite configuration reflects both the early eighth-century Umayyad tradition of wide congregational halls (as seen at Damascus and Derbent) and the seismic wisdom of the Shirvan architectural school, which distributed structural loads across a wide horizontal base.
The 46-by-28-meter interior is partitioned into three spacious square halls (a grand central hall flanked by two symmetrical side halls) linked by wide pointed-arch openings. Uniquely among Azerbaijani mosques, each of the three halls possesses its own richly carved stone prayer niche (Mihrab) set into the southern Qibla wall and its own entrance from the northern portico, allowing more than 1,500 worshippers to pray simultaneously.
The main northern facade overlooking the courtyard is unified by a graceful open portico of pointed arches resting on sturdy stone piers. Rising at the center of the facade is a monumental entrance portal (Pishtaq) richly sculpted with floral arabesques, geometric interlacing (girih), and gilded Arabic calligraphic inscriptions carved into warm cream-colored Shirvan limestone.
Crowning the three prayer halls are three pointed hemispherical domes, with the central dome rising highest (approximately 17 meters) above a polygonal drum pierced by arched clerestory windows inspired by the fifteenth-century royal mausoleums of the Shirvanshahs. During the 2013 restoration, the exterior of all three domes was clad in exquisite geometric mosaic tilework in turquoise, cobalt blue, and warm sand tones.
Flanking the northern facade are two slender cylindrical stone minarets soaring to a height of 36.4 meters. Their limestone shafts are encircled by bands of carved geometric ornament and Kufic Arabic epigraphy commemorating the mosque's original foundation in 126 AH (743 CE). Each minaret is topped by a carved stalactite balcony (muqarnas) and a turquoise-tiled pavilion cupola.
Because Shamakhi lies in a high-intensity earthquake zone, engineers during the 2009 to 2013 restoration underpinned the building with 4-meter-deep foundations and a concealed reinforced-concrete frame integrated within the 2-meter-thick limestone walls, enabling the structure to withstand earthquakes up to magnitude 8 to 9. Inside, the domes are adorned with gold-leafed oriental painting, crystal chandeliers, and handwoven Shirvan prayer carpets.
Enclosing the expansive stone-paved courtyard in front of the mosque are the vaulted stone cells (hujras) of the historic Madrasa, an octagonal ablution pavilion at the center of the plaza, an Islamic library, a conference hall, and an archaeological conservation zone displaying ancient column bases and fire-scorched masonry blocks from the March 1918 tragedy.
| Architectural Component / Historic Relic | Date and Associated Architects | Technical Features and Cultural Significance |
|---|---|---|
| Ancient Foundations and Tripartite Hall Plan | 743 to 744 CE (126 AH); twelfth-century Shirvanshah expansion | 46 × 28 m rectangular footprint divided into three communicating square halls, each with an independent Mihrab |
| Three Domes and Arched Northern Portico | 1859 (Qasim bey Hajibababeyov) and 1902 (Jozef Goslawski, Ziver bey Ahmadbeyov) | Central and flanking domes on windowed drums clad in turquoise geometric tilework above a pointed-arch limestone arcade |
| Twin 36.4-Meter Limestone Minarets | Designed in 1902; fully completed 2009 to 2013 | Symmetrical northern minarets with muqarnas balconies and carved Kufic bands recording the 126 AH foundation date |
| Vaulted Madrasa Cells and Courtyard | 12th to 17th centuries; restored in 2013 | Historic student rooms framing the courtyard where poets and scholars of the Shirvan school once studied |
| March 1918 Fire-Scarred Stones and Epigraphy | Conserved on site during the 2009 to 2013 restoration | Preserves original fire-damaged limestone blocks from March 1918 and medieval foundation stones as historical testimony |
IVMountain Valley Topography and Sacred Orientation
It should be noted that the eighth-century Islamic founders and the master builders of the Shirvan architectural school did not use East Asian feng shui when siting the Juma Mosque of Shamakhi. The sanctuary was placed at the civic heart of the ancient Silk Road capital of Shamakhi, and its three Mihrab prayer niches strictly follow the Islamic rule of Qibla orientation: facing due South (slightly south-southwest by about 13 degrees from Shamakhi's meridian toward the Sacred Kaaba in Mecca). The analysis below offers a comparative environmental reading through the traditional landscape principles of the Van Dao Library.
Examined within the macro-geography of northern Azerbaijan at 40.6301 degrees north latitude and 48.6368 degrees east longitude, the historic city of Shamakhi rests at an elevation of 750 to 800 meters above sea level inside a sheltered mountain amphitheater on the southeastern slopes of the Greater Caucasus range. In classical topographic terms, whereas coastal Baku faces the open Caspian Sea, Shamakhi exemplifies a mountain-encircled valley basin: rising behind the city and mosque to the north and northwest are the high peaks of the Greater Caucasus (including the Pirqulu plateau and Mount Babadag exceeding 2,000 meters), serving as a majestic Ancestral Mountain backing (Black Tortoise) that shields the basin from freezing northern gales, while two mountain rivers, the Pirsaat River to the east and the Aghsu (Zoqalavay) River to the west, embrace the Shamakhi plateau like twin protective water dragons.
Regarding internal spatial composition and orientation, the 46-meter-long rectangular body of the Juma Mosque stretches across the east-west axis like a stabilizing stone screen anchoring the center of the valley. Its arched portico and twin 36.4-meter minarets open northward onto the expansive walled courtyard and ablution fountain, creating a calm Inner Bright Hall (Ming Tang) that gathers vital energy, while the southern Qibla wall housing the three Mihrabs faces straight toward the sunlit southern valley opening toward the Shirvan plain and Mecca. By combining a low-center-of-gravity tripartite horizontal mass with a walled courtyard enclosure, this 1,300-year-old sanctuary maintains a poised, harmonious presence amidst the dramatic mountain terrain of Shirvan.
VFriday Congregational Prayer, Ramadan, Eid al-Adha, and the March 31 Memorial Commemoration in Shamakhi
As the premier spiritual sanctuary of the historic Shirvan region, religious observances at the Juma Mosque of Shamakhi follow the Islamic Hijri lunar calendar alongside national commemorative and cultural events of the Republic of Azerbaijan.
| Time of Year | Calendar System | Major Feast or Commemoration | Characteristic Observances at the Juma Mosque of Shamakhi |
|---|---|---|---|
| Every Friday at Midday (Salat al-Jumu'ah) | Weekly | Congregational Friday Prayer | True to its eighth-century title as the Juma (Friday) Mosque, believers from across Shamakhi and neighboring mountain villages fill the three interconnected halls to hear the Khutbah sermon and pray in unified ranks. |
| Ninth Islamic Month and 1 Shawwal | Islamic Hijri Lunar Calendar | Holy Month of Ramadan, Night of Power (Laylat al-Qadr), and Eid al-Fitr (Ramazan Bayrami) | Nightly Quran recitations, Tarawih prayers, and charitable Iftar meals illuminate the courtyard throughout Ramadan, culminating in the joyful festival prayer on the morning of 1 Shawwal. |
| 10 Dhu al-Hijjah (Twelfth Islamic Month) | Islamic Hijri Lunar Calendar | Feast of the Sacrifice (Qurban Bayrami / Eid al-Adha) | Thousands gather in the three halls and courtyard for the morning festival prayer, followed by charitable distribution of sacrificial meat to needy families across the Shamakhi District. |
| March 31 Annually | Gregorian Calendar (National Day of Remembrance in Azerbaijan) | Commemoration of the Victims of the March 1918 Tragedy | Clergy, residents, and pilgrims gather at the Juma Mosque beside the preserved fire-scarred stones from March 1918 to recite prayers for the hundreds of townspeople who perished inside the sanctuary. |
The anchor of cultural pilgrimage through royal Shirvan and the homeland of Nasimi. Today, any cultural or spiritual journey traveling west from Baku (home to Taza Pir Mosque, Baku, Bibi-Heybat Mosque, Baku, Holy Myrrhbearers Cathedral, Baku, and Ateshgah Fire Temple, Baku) into the mountains of northern Azerbaijan centers upon the Juma Mosque of Shamakhi. From the mosque courtyard, visitors can explore the nearby Yeddi Gumbaz (Seven Domes) Royal Mausoleums of the Shirvanshahs, the cliff-cut Sufi shrine of Diri Baba, and the international Nasimi Festival of Poetry, Art, and Spirituality hosted in Shamakhi to celebrate more than a millennium of Shirvan's literary and spiritual heritage.
VILocation And How To Get There
- Address
- Imadaddin Nasimi Quarter, Shamakhi City Center, Shamakhi District, AZ5600, Republic of Azerbaijan
- Getting there
- The Juma Mosque is located in the historic Imadaddin Nasimi Quarter in the center of Shamakhi city, approximately 118 kilometers west of Baku along the modern four-lane Baku-Shamakhi-Ismayilli Highway (M4). Regular intercity buses and minibuses depart daily from the Baku International Bus Terminal directly to Shamakhi, taking about 1 hour and 45 minutes to 2 hours; from the Shamakhi bus station, the twin 36.4-meter minarets of the Juma Mosque are less than a 5-minute taxi ride or a short walk away.
- Coordinates
- 40.6301, 48.6368
The Juma Mosque of Shamakhi is open daily to worshippers for the five daily prayers and welcomes domestic and international visitors free of charge to explore its courtyard, open-air archaeological display, and three grand prayer halls outside main prayer times. Visitors entering the complex and prayer halls must observe respectful Islamic dress etiquette: men should wear long trousers and sleeved shirts, while women must wear modest loose clothing covering the arms and legs and a headscarf covering the hair (complimentary robes and headscarves are provided at the entrance pavilion). Please remove all footwear and place it on the racks before stepping onto the prayer carpets, and maintain a quiet, respectful demeanor inside the sanctuary.
Nearby places in the library
VIIContribute To This Page
Contribute photos, information or video for Juma Mosque of Shamakhi
Master Ưng Khiêm welcomes the community to enrich this page: a photograph taken on site, a historical detail not yet noted, or a short video. Every contribution is read and answered.
No community contribution yet. You could be the first.
?Quick Questions
Why is the Juma Mosque of Shamakhi recognized as the oldest mosque in Azerbaijan?
During structural investigations following the devastating earthquake of 1902, a scientific commission led by the geologist and engineer Shahsuvarov uncovered an ancient Arabic foundation inscription in the lower masonry recording that the mosque was built in the year 126 of the Islamic Hijri calendar (743 to 744 CE) under the Umayyad general Maslama ibn Abd al-Malik. This makes it the oldest mosque in Azerbaijan and the second oldest in the entire Caucasus after the Derbent Juma Mosque (733 CE).
Which major earthquakes struck the Juma Mosque of Shamakhi and which architects rebuilt it?
Located on the active Caucasian seismic fault, the mosque suffered severe damage in four catastrophic earthquakes in 1192, 1656, 1859, and 1902. After the 1859 earthquake, it was restored by the renowned Shirvan architect Qasim bey Hajibababeyov; following the magnitude 6.9 earthquake of February 13, 1902, Shamakhi native Ziver bey Ahmadbeyov (the first European-trained Azerbaijani architect) and Polish architect Jozef Goslawski designed the monumental triple-domed structure with twin minarets seen today.
How does the interior layout of the Juma Mosque of Shamakhi differ from typical single-domed mosques?
Rather than having a single square chamber beneath one central dome, the Juma Mosque of Shamakhi features a broad rectangular plan measuring 46 by 28 meters that is divided internally into three interconnected square prayer halls linked by wide pointed arches. Remarkably, each of the three halls is crowned by its own dome and possesses its own independent Mihrab prayer niche facing Mecca.
What tragic historical event took place at the Juma Mosque of Shamakhi in March 1918?
During the bloody armed attacks on Shamakhi in March 1918, hundreds of unarmed local residents, including women, children, and the elderly, sought sanctuary inside the ancient Juma Mosque believing the house of God would be spared. Armed Dashnak forces locked the doors and set the mosque ablaze, killing many civilians inside and severely damaging the nearly completed 1902 reconstruction. Original fire-scorched limestone blocks from March 1918 are preserved in the courtyard today as a memorial.
How did the 2009 to 2013 state restoration protect and complete the Juma Mosque?
Carried out under a December 2009 presidential decree and supported by the Heydar Aliyev Foundation, engineers reinforced the mosque with 4-meter-deep foundations and a concealed reinforced-concrete frame inside the 2-meter-thick stone walls to withstand earthquakes up to magnitude 8 to 9. At the same time, artisans completed the three turquoise-patterned domes, the twin 36.4-meter minarets from the 1902 Goslawski-Ahmadbeyov design, and the historic Madrasa cells before the grand reopening on May 17, 2013.
What role did the Juma Mosque complex play in the intellectual and literary history of Shirvan?
Throughout the medieval era under the Shirvanshah dynasty, the vaulted cells (hujras) surrounding the mosque courtyard functioned as a major Islamic university college (Madrasa) teaching theology, astronomy, philosophy, and classical literature. This scholarly environment helped shape the golden age of Shirvan poetry in Shamakhi, the birthplace of twelfth-century master poet Khaqani Shirvani and fourteenth-century mystical philosopher-poet Imadaddin Nasimi.