Shirvan from map of the Caucasus by Johann Christoph Matthias Reinecke. 1804

Shirvan (from Persian: شروان‎, romanizedShirvān; Azerbaijani: Şirvan; Tat: Şirvan), also spelled as Sharvān, Shirwan, Shervan, Sherwan and Šervān, is a historical region in the eastern Caucasus, known by this name in both Islamic and modern times.[1] Today, the region is an industrially and agriculturally developed part of the Azerbaijan Republic that stretches between the western shores of the Caspian Sea and the Kura River, centered on the Shirvan Plain.[2]

Vladimir Minorsky believes that names such as Sharvān (Shirwān), Lāyzān and Baylaqān are Iranian names from the Iranian languages of the coast of the Caspian Sea.[3]

However, Said Nafisi points out that according to Khaqani's poems, where Khaqani contrasts his home town with kheyrvān (Persian: خیروان‎), the original and correct pronunciation of the name was Sharvān. So all etymologies relating this name to sher/shir (lion in Persian and Kurdish) or Anushiravan are most probably folk etymology and not based on historical facts. The form Shervān or Shirvān are from later centuries. According to the Encyclopedia of Islam, Shirwan proper comprised the easternmost spurs of the Caucasus range and the lands which sloped down from these mountains to the banks of the Kur river. But its rulers strove continuously to control also the western shores of the Caspian Sea from Ḳuba (the modern town of Quba) in the district of Maskat in the north, to Baku in the south. To the north of all these lands lay Bab al-Abwab or Derbend, and to the west, beyond the modern Goychay, the region of Shaki. In mediaeval Islamic times, and apparently in pre-Islamic Sāsānid ones also, Shirwan included the district of Layzan, which probably corresponds to modern Lahidj, often ruled as a separate fief by a collateral branch of the Yazidi Shirwan Shahs.[6]

The 19th century native historian and writer Abbasgulu Bakikhanov defines it as: "The country of Shirvan to the east borders on the Caspian Sea, and to the south on the river Kur, which separates it from the provinces of Moghan and Armenia".[7]

Shirvanshah also spelled as Shīrwān Shāh or Sharwān Shāh, was the title in medieval Islamic times of a Persianized dynasty of Arabic origin.[6] They ruled the area independently or as a vassal of larger empires from 800 A.D. up to 1607 A.D. when Safavid rule became firmly established.

When the Shirvanshah Shah dynasty was ended by the Safavid Shah Tahmasp I, Shirwan formed a province of the Safavids and was usually governed by a Khan, who is often called Beylerbey.[1] Shirvan was taken by the Ottomans in 1578; however, Safavid rule was restored by 1607.[1] In 1722, during the Russo-Persian War (1722-1723), the Khan of Quba, Husayn Ali, submitted to Peter the Great and was accepted as his dignitary. The Treaty of Saint Petersburg (1723) forced the Iranian king to recognise the Russian annexation. By the treaty between the Russian and Ottoman Empires in the year 1724, the coast of the territory of Baku, which was occupied by the Russians, was separated from the rest of Shirvan, which was left to the Ottomans. It was only when Nader Shah defeated the Ottomans (1735) that the Russians ceded back the coastal land and the other areas in the North and South Caucasus as conquered in 1722-1723 from Safavid Iran conform the Treaties of Resht and Ganja, and the area became part of the Afsharid Empire,[1] by which century long Iranian rule was restored.

When the Qajars had succeeded in restoring the unity of Persia, the sons of the Khan were no more able to maintain their independence like the other Caucasian chiefs and had to choose between Russia and Persia.[1] The Khan of Shirwan, Mustafa, who had already entered into negotiations with Zubov, submitted to the Russians in 1805, who occupied the Persian cities of Derbend and Baku the next year (1806) during the Russo-Persian War (1804-1813), but soon afterwards he made overtures to the Persians and sought help from them.[1] By the Treaty of Gulistan (12/24 October 1813) following the end of the 1804-1813 war, Persia was forced to cede its territories and regions comprising Darband, Quba, Shirwan and Baku, while giving up all claims on them as well.[1] Nevertheless, Mustafa continued to have secret dealings with Persia. It was not until 1820 that his territory was occupied by Russian troops; the Khan fled to Persia and Shemakha was irrevocably incorporated in Russian territory.[1] Iranian anger while being dissatisfied with losing swaths of its integral territories in the North and South Caucasus subsequently sparked the Russo-Persian War (1826-1828), which resulted in another Iranian loss, as well as the ceding of its last remaining territories in the Caucasus comprising what is now Armenia, and southern parts of the contemporary Republic of Azerbaijan. The Treaty of Turkmenchay of 1828 officially ratified the forced ceding of these Iranian territories to Imperial Russia, while it would also mark the official end of millennia long intertwined Iranian hegemony, rule, and influence over the Caucasus region, including Shirvan.

Shirvan Tatar (i.e. Azeri). Engraving from book of Jean Baptiste Benoît Eyriès. Voyage pittoresque en Asie et en Afrique: résumé général des voyages anciens et modernes... T. I, 1839

The term Shirvani/Shirvanli is still in use in Azerbaijan to designate the people of Shirvan region, as it was historically.[8] Since ancient time, the bulk population of Shirvan were Caucasian speaking groups. Later on Iranization of this native population and subsequent Turkification since the Seljuq era occurred. The bulk of the population today are Turkic-speaking Azerbaijanis, although there are also smaller Caucasian speaking and Iranian speaking minorities.

The original population were Paleo-Caucasians and spoke Caucasian languages, like the Caucasian Albanians. Today, other Daghestani Caucasian languages such as Udi, Lezgian and Avar are still spoken in the region.

Iranian penetration started since the Achaemenid era and continued in the Parthian era. However it was during the Sassanid era that the influence really increased and Persian colonies were set up in the region. According to Vladimir Minorsky: .[9] Abu al-Hasan Ali ibn al-Husayn Al-Masudi (896–956), the Arab historian states Persian presence in Aran, Bayleqan, Darband, Shabaran, Masqat and Jorjan.[10] From 9th century, the urban population of Shirwan increasingly moved to Persian language,[11][12] while the rural population seems to mostly have retained their old Caucasian languages. Up to the nineteenth century, there was still a large number of Tat population (who claim to be descendants of Sassanid era Persian settlers), however due to similar culture and religion with Turkic-speaking Azerbaijanis, this population was partly assimilated.[13]

The presence of Iranian settlers in Transcaucasia, and especially in the proximity of the passes, must have played an important role in absorbing and pushing back the aboriginal inhabitants. Such names as Sharvan, Layzan, Baylaqan, etc., suggest that the Iranian immigration proceeded chiefly from Gilan and other regions on the southern coast of the Caspian

Turkic penetration in the region started in the Khazar era, however there are no unambiguous references to settlements.[14] The Turkification of the region started in the Seljuq era, although the area in parallel maintained its Persian culture under the Persianized Shirvanshah until the Safavid era. From the Safavid era onwards, the Turkification of the region accelerated with new wave of Turkoman settlements.[15]