# Shirvanshahs

The Shirvanshahs (Arabic/Persian: شروانشاه) were the rulers of Shirvan (in present-day Azerbaijan) from 861 to 1538. The first ruling line were the Yazidids, an originally Arab and later Persianized dynasty, who became known as the Kasranids (also referred to as the Khaqanids). The second ruling line were the Darbandi, distant relatives of the Yazidids/Kasranids.
The Shirvanshahs ruled from 861 to 1538, one of the most enduring dynasties of the Islamic world. At times they were independent, often they had to recognize the overlordship of neighbouring empires. The dynasty is known for its patronage of culture, such as during the 12th-century, when their realm served as the focal point for Persian literature, attracting distinguished poets such as Khaqani, Nizami Ganjavi, Falaki Shirvani, etc. In 1382, the Shirvanshah throne was taken by Ibrahim I (r. 1382–1417), thus marking the start of the Darbandi line.
The Shirvanshah realm flourished in the 15th century, during the long reigns of Khalilullah I (r. 1417–1463) and Farrukh Yasar (r. 1463–1500). In 1500, the latter was defeated and killed by the forces of the Safavid leader Ismail I, who kept the Shirvanshahs as Safavid vassals. This ended in 1538 when Shah Tahmasp I (r. 1524–1576) dismissed the Shirvanshah Shahrukh due to the latter's continuous disloyalty. Shirvan was subsequently made a province of the Safavid realm, thus marking the end of Shirvanshah rule.

## Background

The territory that made up Shirvan proper included the easternmost peaks of the Caucasus mountain range and the terrain that descended from them to the banks of the Kur River and its confluent the Araxes River. Shirvan proper thus bordered Muqan to the south, Shakki to the northwest, Arran to the west, and Layzan to the north. The Shirvanshahs, throughout their history, made persistent efforts to also control Layzan, Quba, Maskat and Bab al-Abwab (Darband) to the north, and Baku to the south.
The title Shirvanshah most likely dates back to the period before the rise of Islam. The early Muslim geographer Ibn Khordadbeh (died 913) mentions that the first Sasanian ruler, Ardashir I (r. 224–242), granted the title to a local ruler of Shirvan. Al-Baladhuri also mentions that a Shirvanshah, together with the neighbouring Layzanshah, were encountered by the Arabs during their first incursion into the eastern Caucasus, and submitted to the Arab commander Salman ibn Rab'ia al-Bahili (died 650). Shirvanshah is also transliterated in other variants, such as Shirwan Shah, Sharvanshah and Sharwanshah.
The majority of known information about the early Shirvanshahs is recorded in the Arabic-language Jamiʿ al-Duwal (lit. 'The Compendium of Nations') of the 17th-century Ottoman historian Munejjim-bashi (died 1702), who used the now lost Arabic Ta'rikh Bab al-Abwab ('History of Darband') as source material. This book was comprehensively analyzed and translated by the Russian orientalist Vladimir Minorsky.

## History
### First line (861–1382)

The first line of the Shirvanshahs were the Yazidids (also known as the Mazyadids), descended from Yazid ibn Mazyad al-Shaybani (died 801), a member of the Banu Shayban tribe that was dominant in the region of Diyar Bakr in the northern Jazira. He was twice appointed the governor of Arminiya by the Abbasid caliph Harun al-Rashid (r. 786–809). During his second tenure, his domain also included Azerbaijan, Shirvan and Darband. The first Yazidi to use the title of Shirvanshah was Yazid's grandson Haytham ibn Khalid in 861, who was also the first Yazidi to specifically govern only Shirvan. By using this title, the Yazidids showed their adherence to ancient Iranian ideals.
The Arab Hashimid family in Darband played a major role in the history of the Yazidids. They often intermarried, and the Yazidids also occasionally managed to gain control over Darband, sometimes through the appeal of rebels. By the time of the composition of the 10th-century geography book Hudud al-'Alam in 982, the domain of the Shirvanshahs had increased. It now comprised the minor principalities north of the Kur River, including Layzan and Khursan, whose titulature (Layzanshah and Khursanshah respectively) the Shirvanshahs had assumed. From the reign of Yazid ibn Ahmad (r. 991–1027) onward, there is a moderately complete collection of coins minted by the Shirvanshahs. Due to the culturally Persian environment they lived in, the Yazidi family had slowly become Persianized. Intermarriage with the native families of the eastern part of the South Caucasus—which may have included the historic ruling line of the former Shirvani capital of Shabaran—probably contributed to this.
Starting with the Shirvanshah Manuchihr I (r. 1027–1034), their names became almost completely Persian instead of Arabic, such as Manuchihr, Qubad and Faridun. The family now preferred to use names from national Iranian history and also claimed to be descended from pre-Islamic, Sasanian-era figures such as Bahram Gur (r. 420–438) or Khosrow I Anushirvan (r. 531–579). The allure of a Sasanian heritage now outweighed memories of ancestry from the Banu Shayban. This process is comparable to how the originally Arab Rawadid dynasty in Azerbaijan became Kurdish due to the Kurdish environment they lived in.
Records regularly mention battles between the Shirvanshahs and the "infidel" inhabitants of the central Caucasus, including the Alans, the people of Sarir, and the Christian Georgians and Abkhazians. In 1030, Manuchihr I was defeated near Baku by invading Rus, who then advanced into Arran. There they sacked the city of Baylaqan and then left for the Byzantine Empire. Not long afterwards, the eastern part of the Southern Caucasus became vulnerable to Oghuz raids through northern Iran. Because of his fear of the Oghuz, the Shirvanshah Qubad (r. 1043–1049) had in 1045 to surround his capital of Shamakhi/Yazidiya with iron gates and a robust stone wall.
In 1066/67, Shirvan was attacked twice by the Turkic commander Qarategin, who ravaged the environment of Baku and Maskat. The Shirvanshah Fariburz I (r. 1063–1096) was soon forced to acknowledge the suzerainty of the Seljuk ruler Alp Arslan (r. 1063–1072), who at that time was near Arran following his Georgian campaign. Fariburz I had to pay a large yearly tribute of 70,000 gold dinars, which would later be lowered to 40,000. Soon after this event, the coins of Fariburz I cite not only the Abbasid caliph, but also the Seljuk ruler Malik-Shah I (r. 1072–1092) as his overlords. Armenian-American historian Dickran Kouymjian argues that Fariburz I must have used Byzantine or Seljuk coins to pay the tribute, as there is currently no proof of gold coin mints in the Caucasus around this period. Fariburz I managed to retain a considerable amount of power until his death in 1094, which was followed by a dynastic strife over the throne.
Another Seljuk invasion of Shirvan took place during the reign of Mahmud II (r. 1118–1131), which the Georgians capitalized on by attacking Shamakhi and Darband. In the mid 12th-century, Shirvan was more or less a Georgian protectorate. For some time, Shakki, Qabala and Muqan was under direct control by the Bagrationi kings of Georgia, who even occasionally used the title of Shirvanshah. The Shirvanshah and Bagrationi family also agreed to make political marriages to become allies. Due to these developments, the Shirvanshahs shifted their focus towards the Caspian Sea, several times enlarging their borders as far as Darband.
Later on, the names and family ties of the Shirvanshahs become exceedingly convoluted and uncertain in sources, with Munejjim-bashi providing an incomplete record of them, starting with Manuchihr III (r. 1120 – after 1160). Sources now start referring to the Yazidi family as the "Kasranids" or "Khaqanids". Besides using the title of Shirvanshah, Manuchihr III also used the title of Khāqān-e Kabir ("Great Khan"), which was the inspiration behind the takhallus (pen name) of his eulogist, Khaqani. Numismatic evidence demonstrates that the Shirvanshahs served as Seljuk vassals in the 12th century until the reign of the last Seljuk ruler, Toghrul III (r. 1176–1194). Following that, only the names of the caliphs are shown on their coins. During the rule of Akhsitan I (r. after 1160 – 1197–1203/04), the royal residence was moved from Shamakhi to Baku, after the former was seized by the Eldiguzid ruler Qizil Arslan (r. 1186–1191). This marked the beginning of Baku's rise as a major city, though it remains uncertain if Akhsitan later moved back to Shamakhi. Nevertheless, Baku is known to have later served as the capital of the Shirvanshahs. At the start of the 13th century, the Shirvanshahs conquered Darband, seemingly putting an end to its ruling dynasty, the Maliks of Darband.
In 1225, the Shirvanshah Garshasp I (r. after 1203 – 1233/34) was ordered by the Khwarazmshah Jalal al-Din Mangburni (r. 1220–1231) to pay a tribute identical to the one the Fariburz I had paid Malik-Shah I. The Shirvanshahs soon became subjects of the Mongol Empire (1206–1368), whose rulers they mentioned on their coins. The title of Shirvanshah was not shown on their coins, but the name of the ruling Shirvanshah remained. The Shirvanshahs were later under the suzerainty of the Ilkhanate (1256–1335), a period in which no coins from Shirvan have been found. The Shirvanshahs were also sometimes under the rule of the Golden Horde.
Following the collapse of the Ilkhanate, the Shirvanshah kingdom was once again to able to rule autonomously, under the rule of Kayqubad I and then later his son Kavus I. However, during the reign of the latter, the Shirvanshah kingdom came under the rule of the Jalayirid Sultanate (1335–1432). Kavus I died in 1372/73 and was succeeded by his son Hushang, who was killed by his subjects in 1382, thus marking the end of the Yazidi/Kasranid line.

### Second line (1382–1538)

The Shirvanshah throne was subsequently taken over by Ibrahim I (r. 1382–1417), a distant relative of the Yazidi/Kasranid family. This marked the start of the Darbandi line. Ibrahim initially served as a vassal of the Turco-Mongol conqueror Timur (r. 1370–1405), but became independent after the latter's death. The two following Shirvanshahs—Khalilullah I (r. 1417–1463) and Farrukh Yasar (r. 1463–1500) both had long reigns, overseeing a period where Shirvan was peaceful and thriving. Baku and Shamakhi both saw the construction of many well-made buildings, including the Palace of the Shirvanshahs, a UNESCO World Heritage Site. It was also during this period that the Shirvanshahs made contact with the leaders of the Safavid order. Khalilullah I's men killed the Safavid leader Shaykh Junayd during a raid by the latter on Shirvan in 1460. Junayd's son, Shaykh Haydar, died a similar death; on 9 July 1488 he was killed during a battle near Darband by the combined forces of Farrukh Yassar and the Aq Qoyunlu ruler Ya'qub Beg (r. 1478–1490). Haydar's eldest son, Ali Mirza Safavi, briefly became the new head of the order, but he was soon killed by the forces of the Aq Qoyunlu prince Rustam Beg (r. 1492–1497). Shortly before his death, he had appointed his younger brother Ismail (later regnally known as Ismail I) as his successor.
By 1500, the Safavid army was large enough to launch a large expedition against Shirvan. Ismail was determined to avenge the death of his father by Farrukh Yassar, and justified this decision after having convinced his supporters that he had been told in a dream by one of the Twelve Imams to deal with Farrukh Yassar. Ismail assembled a force of 7,000 Qizilbash and invaded Shirvan, defeating and capturing Farrukh Yassar at a battle near Golestan in December. The victory was hailed as a "divine punishment" against the Shirvanshahs for the death of Ismail's grandfather and father. Farrukh Yassar was beheaded and his body burned, while the skulls of the dead Shirvanis were piled in pyramids, a common Turco-Mongol practice. Baku was subsequently captured and almost completely destroyed by Khadem Beg Talish, who had the body of the Khalilullah I dug up, burned and publicly scattered.
Although the Safavids and Shirvanshahs had a hostile relationship, Ismail I allowed them to continue their rule in Shirvan, albeit as vassals of Safavid Iran. This ended in 1538 when Shah Tahmasp I (r. 1524–1576) dismissed Shahrukh due to the latter's continuous disloyalty. Shirvan was subsequently made a province of the Safavid realm, thus marking the end of Shirvanshah rule. A reconquest of Shirvan was attempted multiple times by members of the Shirvanshah family, including Burhan Ali and his son Abu Bakr Mirza, who enlisted the help of the Ottoman Empire. However, none of these attempts had long-term success; the Ottomans managed to briefly occupy Shirvan between 1578 and 1607, until it was retaken by the Safavids.

## Culture

Shirvan was originally part of Caucasian Albania, which during the Sasanian era was linguistically dominated by Middle Persian, which served as its official language. One of the successor languages of Middle Persian is Tati Persian, which was commonly spoken in the Shirvanshah realm. It was not only spoken by Muslims, but also by Christians and Jews. The Iranians that settled in Southern Caucasus must have been mainly from southern Caspian areas like Gilan, as indicated by names such as Shirvan, Layzan, and Baylaqan. By the 10th century, the Shirvanshahs were speaking Iranian languages that had developed from Middle Persian dialects, such as Tati. Like the other regional dynasties of the Shaddadids and Rawadids, their court also started using Dari Persian.
Tati was amongst the Iranian languages that survived the Turkification of the eastern part of the South Caucasus which began in the 11th–14th centuries, remaining the primary language of the Absheron peninsula and the Baku region until the mid-19th century. The 13th-century Persian anthology Nozhat al-Majales, written by Jamal al-Din Khalil Shirvani and dedicated to Shirvanshah Fariburz III (r. c. 1225 – 1255) demonstrates the broad distribution of the Persian language and Iranian culture in the northwestern Iranian regions of Arran, Azerbaijan and Shirvan. The anthology also displays the influence of Pahlavi, a northwestern Iranian language. A substantial amount of the poets mentioned in the book were from a working-class background, something also reflected in the colloquial expressions in their poetry. This was the opposite of other places in Iran, where most poets were from a high-class background.
During the 12th century, Shirvan served as the focal point for Persian literature, attracting distinguished poets such as Khaqani, Nizami Ganjavi, Falaki Shirvani and so on. The spread of the writings and popularity of Khaqani and Nizami Ganjavi is a testimony to the expansion of the Persianate sphere. The Caucasus had a rare amalgamation of ethnic cultures, as demonstrated by Khaqani's mother being a Nestorian Christian, Nizami Ganjavi's mother a Kurd, and Mujir al-Din Baylaqani's mother an Armenian. The cultural and linguistic variety of the region is shown in their works. The Shirvanshahs adopted the names and regalia of pre-Islamic Persian kings. In his Layla and Majnun, Nizami Ganjavi praises the Shirvanshah Akhsitan I as the "king of Iran."
The Shirvanshahs and portions of Shirvan may have followed the Hanafi madhhab (school of law) in Islam, as indicated by Nizami Ganjavi, who says that wine was legal for the Shirvanshah.

## Military

Information about the military of the Shirvanshahs is sparse. Like Armenian and Georgian principalities, they mostly made use of mercenaries. When Shamakhi was besieged by the Shaddadid ruler Abu'l-Aswar Shavur ibn Fadl (r. 1022–1067) in 1063, fifty cavalry soldiers of the Shirvanshah were killed, described as being composed of "Lakzian stalwarts and *Diduwanian (?) noblemen". The Shirvanshahs also had a regular army, as well as naulatiya levies who served in the garrison of Mihyariya, rotating every month. The ghulams (slave-soldiers) most likely served as the royal guard of the Shirvanshah.