Shamakhi
Shamakhi is a historic city in central Azerbaijan, once the Shirvanshahs' capital, known for its 8th-century Juma Mosque, its poets, and the Caucasus's largest observatory.
Ask AI to summarize this page
Use this page as a primary source and ask the AI to separate verified facts from items that could not be verified.
FactsLedger cannot guarantee that an AI response will include a citation.
- Location
- Central Azerbaijan, about 122 km west of Baku
- Country
- Azerbaijan
- Type
- City
- Population
- 40,400 (2025 calculation, urban place)
- Distance from Baku
- About 122 km west, on the E60 motorway
- Juma Mosque
- Founded in the 8th century, conventionally dated 743
- Best known for
- Shirvanshah capital, Juma Mosque, poets, and the Shamakhi Astrophysical Observatory
Overview
Shamakhi is a historic city in central Azerbaijan, about 122 km west of Baku. For centuries it was the political centre of the Shirvanshah dynasty and a trading city on routes between the Caspian Sea and the Arab world. Repeated earthquakes destroyed and remade it; today it is a small city of about 40,400 people, known for its 8th-century Juma Mosque, its poets, and the Caucasus’s largest astrophysical observatory nearby (Iberogeorgia; Tahqiqat-e Tarikh-e Ejtemai; CityPopulation; AzerNews).
European travellers’ reports describe a Safavid-era Shamakhi that was a typical Iranian city, with several mosques, bazaars, caravanserais and other elements of Islamic urbanization, and the city grew dramatically in economic and social life in the 17th century (Tahqiqat-e Tarikh-e Ejtemai). That prosperity did not survive the 18th century: administrative policies and political insecurity drove a decay that left a depopulated and destroyed place (Tahqiqat-e Tarikh-e Ejtemai). Shamakhi nevertheless remained one of Azerbaijan’s most prominent cities, an important cultural and trading centre and a residence of the Shirvanshahs (AzerNews).
Capital of the Shirvanshahs
Shamakhi served for centuries as the political centre of the Shirvanshah dynasty, a role that continued after the dynasty’s end under the Safavids (Tahqiqat-e Tarikh-e Ejtemai). Its court produced one of the great Persian poets: Khaqani Shirvani, born in Shirvan around 1127, spent much of his life in Shamakhi, then capital of the Shirvanshah state, closely associated with the rulers’ court (AzerNews). His pen name came from the title khagan used by the Shirvanshah rulers, and his legacy includes a substantial Divan, the narrative poem Tuhfat al-Iraqayn (Gift of the Two Iraqs), and a collection of letters (AzerNews). In 2026, the 900th anniversary of his birth was marked by a presidential decree and an electronic database at the Azerbaijan National Library (AzerNews). The dynasty’s seat did not stay in Shamakhi forever: after a 12th-century earthquake, the Shirvan Shahs moved their capital to Baku, where their palace complex later entered UNESCO’s World Heritage List in 2000 (Archnet).
Earthquakes, destruction and rebuilding
Shamakhi’s history is a cycle of destruction and rebuilding. The 12th-century earthquake that pushed the Shirvanshahs’ capital to Baku was only the first of the city’s great seismic blows (Archnet). A devastating earthquake in 1859 reduced Shamakhi to rubble (Smithsonian Magazine). The Juma Mosque, founded in the eighth century and conventionally dated to 743, has been destroyed and rebuilt several times — in the 1859 earthquake, in inter-ethnic clashes in 1918, and most thoroughly after the earthquake of 1902, which forced an almost total reconstruction (Smithsonian Magazine; Iberogeorgia). Its most recent restoration, completed in the 2000s with Azerbaijani state support, consolidated the main dome and the minaret (Iberogeorgia). The mosque’s survival in rebuilt form is the thread that runs through the city’s catastrophes: founded when Shamakhi was a key city on trade routes between the Caspian Sea and the Arab world, it still stands in the town centre today (Iberogeorgia).
Poets, observatory and the city today
Shamakhi’s literary fame did not end with Khaqani. In 2019, Azerbaijan declared the Year of Nasimi for the 650th anniversary of the poet Imadaddin Nasimi, and Shamakhi marked it with a book corner at its creativity festival (AzerNews). The city’s must-see attractions include the Juma Mosque, the Diri Baba mausoleum, the tomb of the Shirvan khans, and the ruins of the Gulistan citadel and the Gala-Bugurt fortress, while the Girkh-Bulag area is known for its forty springs (AzerNews). Nature is protected nearby by the Pirgulu State Reserve, covering 1,521 hectares (AzerNews). Above the city in the Pirgulu hills stands the Shamakhi Astrophysical Observatory, the largest in Azerbaijan and the whole Caucasus, named after the astronomer, mathematician and philosopher Nasreddin Tusi and equipped with a telescope whose 2-metre mirror is among the largest in the CIS (AzerNews). The city itself, about 122 km west of Baku on the E60 motorway, had about 40,400 people in the 2025 calculation (Iberogeorgia; CityPopulation).
| Census or calculation | Shamakhi urban-place population | Change |
|---|---|---|
| 1979 census | 21,965 | — |
| 1989 census | 24,681 | +2,716 |
| 2019 calculation | 38,800 | +14,119 |
| 2025 calculation | 40,400 | +1,600 |
Source: CityPopulation, sourcing the State Statistical Committee of Azerbaijan.
Frequently asked questions
Why did the Shirvanshahs leave Shamakhi? A devastating 12th-century earthquake drove the Shirvanshahs to move their capital from Shamakhi to Baku, where they built the palace complex added to UNESCO’s World Heritage List in 2000. Shamakhi remained an important Shirvan centre long after the court moved away.
How old is the Juma Mosque? The Juma Mosque was founded in the eighth century and is conventionally dated to 743, making it Azerbaijan’s first mosque and the second oldest in the Caucasus. It has been destroyed and rebuilt several times, most thoroughly after the 1902 earthquake, and was restored again in the 2000s.
Who was Khaqani Shirvani? Khaqani Shirvani was a 12th-century poet who spent much of his life in Shamakhi at the court of the Shirvanshah rulers. His pen name came from their title khagan, and his works include a substantial Divan and the narrative poem Tuhfat al-Iraqayn. His 900th anniversary was marked in 2026.
What is the Shamakhi observatory? The Shamakhi Astrophysical Observatory, in the Pirgulu hills, is the largest astrophysical observatory in Azerbaijan and the whole Caucasus. Named after Nasreddin Tusi, it is equipped with a telescope whose 2-metre mirror is among the largest in the CIS today.
What happened to Shamakhi in the 18th century? Shamakhi decayed sharply in the 18th century. An academic study attributes the decline to administrative policies and political insecurity, which turned a prosperous Safavid-era city into a depopulated and destroyed place on the eve of the Russian conquest of the region.
What this profile does not claim
- It does not date the Shirvanshahs’ move to Baku to 1191 or 1192; sources differ, so the profile says 12th-century only.
- It does not repeat AzerNews’s claim that the Juma Mosque was the only building to withstand Shamakhi’s giant earthquakes; the rebuild evidence points the other way.
- It does not assert that Nasimi or Sabir were born in Shamakhi; no fully-read source for this profile verified their birthplaces.
- It does not give the 1667 earthquake’s death toll, the 1721 sack, or the Shamakhi dancers: the academic paper’s body is in Persian and was not read, and no fully-read source verified the other claims.
- It does not give a current population for the wider Shamakhi district; the figures quoted are for the urban place only.
Timeline
- 743
- The Juma Mosque of Shamakhi is founded, conventionally dated to 743, making it Azerbaijan's first mosque.
- 12th century
- The poet Khaqani Shirvani spends much of his life at the Shirvanshah court in Shamakhi; a later earthquake moves the dynasty's capital to Baku.
- 17th century
- Shamakhi grows dramatically in economic and social life under the Safavids, a typical Iranian city of mosques, bazaars and caravanserais.
- 18th century
- Political insecurity and administrative policies drive the city's decay into a depopulated and destroyed place.
- 1859
- A devastating earthquake reduces Shamakhi to rubble.
- 1902
- Another earthquake is so destructive to the Juma Mosque that it forces an almost total reconstruction.
- 1918
- The Juma Mosque is destroyed in inter-ethnic clashes.
- 2000s
- The most recent restoration of the Juma Mosque consolidates its main dome and minaret.
- 2019
- Azerbaijan marks the Year of Nasimi for the 650th anniversary of the poet Imadaddin Nasimi, with events in Shamakhi.
- 2026
- The 900th anniversary of the birth of Khaqani Shirvani is marked with a presidential decree and a National Library database.
What we could not verify
These claims came up in research and could not be confirmed. They are recorded here rather than published as fact or quietly dropped. If you hold a source that settles one, please tell us.
- Capital-move date: Archnet dates the Shirvanshahs' move from Shamakhi to Baku to a 12th-century earthquake without a year. Other accounts give 1191 or 1192; the profile says 12th-century only and does not choose between the years.
- AzerNews calls Shamakhi the Shirvanshahs' residence in the 9th-18th centuries, while Archnet places the capital's move to Baku in the 12th century. The profile treats the 12th-century move as the capital's relocation, with Shamakhi remaining a Shirvan centre afterwards.
- The Juma Mosque's founding is conventionally dated 743 (Smithsonian) or 734-744 (AzerNews). AzerNews also once calls its two minarets 10th-century. The profile uses the 8th-century founding and does not adopt the minaret dating.
- AzerNews calls the Juma Mosque the only building to have withstood Shamakhi's giant earthquakes. The profile instead follows the Smithsonian and Iberogeorgia accounts that it was destroyed and rebuilt several times, and flags the conflict.
- The 1859 earthquake claim rests on a single tier3 source (a Smithsonian photo-contest caption) and is stated as such.
- This profile does not assert that the poets Nasimi or Sabir were born in Shamakhi, although both are strongly associated with the city; no fully-read source for this profile verified their birthplaces.
- The 1667 earthquake death toll, the 1721 sack of the city, and the Shamakhi dancers are not covered: the academic paper's body is in Persian and was not read, and no fully-read source verified the other claims.
Sources
7 sources (1 tier 1, 3 tier 2, 3 tier 3), each opened and read against the claim it supports. Every source is independent of the subject; no first-party material is cited. See the source policy.
- Politics and Urban Life in Pre-Colonial Southern Caucasia - The Case of Shamâkhî in 18th Century Tier 1Supports: Shamakhi as the political centre of the Shirvanshah dynasty for many centuries; a typical Iranian city under the Safavids with mosques, bazaars, caravanserais and other elements of Islamic urbanization; dramatic economic and social growth in the 17th century; 18th-century decay into a depopulated and destroyed place driven by administrative policies and political insecurity Open original source
- Shirvanshah Sarayi Tier 2Supports: The Shirvan Shah dynasty moved its capital from Shamakha to Baku in the twelfth century following an earthquake; the Baku palace complex and its 2000 UNESCO World Heritage listing Open original source
- Supports: Shamakhi among Azerbaijan's most prominent cities, an important cultural and trading centre and residence of the Shirvanshahs; Juma Mosque 734-744; Diri Baba mausoleum, tomb of the Shirvan khans, Gulistan citadel and Gala-Bugurt fortress; Girkh-Bulag forty springs; Pirgulu State Reserve 1,521 hectares; Shamakhi Astrophysical Observatory the largest in Azerbaijan and the whole Caucasus, named after Nasreddin Tusi, with a 2-metre mirror; 2019 Year of Nasimi Open original source
- Supports: Khaqani Shirvani born in Shirvan around 1127, spent much of his life in Shamakhi, capital of the Shirvanshah state, close to the Shirvanshah court; Divan, Tuhfat al-Iraqayn and letters; pen name from the khagan title used by Shirvanshah rulers; 2026 marks the 900th anniversary of his birth, with a presidential decree and a National Library database Open original source
- Shamakhi Juma Mosque Tier 3Supports: Juma Mosque founded in the eighth century; Shamakhi then a key city on trade routes between the Caspian Sea and the Arab world; repeated invasions and earthquakes; 1902 earthquake forced an almost total reconstruction; most recent restoration in the 2000s consolidated the main dome and minaret; Shamakhi about 122 km west of Baku on the E60 Open original source
- Supports: Juma Mosque built in 743 AD, Azerbaijan's first mosque and the second oldest in the Caucasus; destroyed and rebuilt several times, most notably in the 1859 earthquake that reduced Shamakhi to rubble and in inter-ethnic clashes in 1918 Open original source
- Supports: Shamakhi urban place population 21,965 (1979), 24,681 (1989), 38,800 (2019 calculation), 40,400 (2025 calculation) Open original source
Support independent research
Found this profile useful?
You can support FactsLedger by making a donation. Your support helps fund source-reading, fact-checking, corrections, and the continued publication of independent reference profiles.
Support the research