Shemakha is often regarded as the heart of Shirvan, a region with a storied past that dates back thousands of years. From the 9th to the 16th centuries, it served as the principal city of the Shirvan Kingdom, a period marked by cultural and economic flourishing. Archaeological excavations in the northwestern part of the city have unearthed remnants of settlements, indicating that a city existed in this area as far back as 2500 to 3000 years ago. The ancient Greek historian Ptolemy even mentioned Shemakha among the cities of Caucasian Albania, highlighting its significance in historical texts.
In the early 10th century, Shemakha became the capital of the feudal state ruled by the Shirvanshahs. However, in 1222, after a prolonged siege, the city fell to the Mongol-Tatars, who devastated it. A 13th-century work by an unknown author describes Shemakha as “a city in Arran, a highly fortified place with inhabitants who are extraordinarily fanatical in matters of faith.” This description underscores the city’s strategic importance and the fervor of its people.
The city’s location at the crossroads of major trade routes made it a target for numerous raids over the centuries. Shemakha faced relentless attacks from neighboring tribes and armies from other khanates, which repeatedly plundered and destroyed the ancient capital of Shirvan.
For a long time, Shemakha was one of the key points along the Great Silk Road. As a hub of caravan routes, it emerged as a significant trade and craft center in the Middle East. Azerbaijani, Iranian, Arab, Central Asian, Russian, Indian, and Western European merchants traded here, establishing trading posts and contributing to the city’s vibrant economy. Numerous silk-weaving, paper-spinning, and carpet-making workshops flourished in Shemakha, showcasing the region’s rich artisanal traditions.
In 1721, Shemakha suffered an attack by the forces of Khoja Daud, resulting in the deaths of Russian merchants and significant losses for those trading silk. This incident prompted Peter I to launch a Persian campaign between 1722 and 1723, marking the beginning of a series of Russian-Persian conflicts. Later, in 1742, Iranian troops devastated Shemakha once again.
During the 18th and 19th centuries, Shemakha served as the capital of the Shirvan Khanate. The annexation of the Shirvan Khanate by Russia in 1805 was solidified by the Treaty of Gulistan in 1813, further integrating the region into the Russian Empire.
From 1840 to 1846, Shemakha acted as the administrative center of the Caspian Province, and subsequently, until 1859, it was the center of the Shemakha Governorate. However, a devastating earthquake on December 2, 1859, led to the relocation of the provincial capital to Baku. Following this disaster, Shemakha became the administrative center of the Shemakha District within the Baku Governorate.