Bavand dynasty

The Bavand dynasty (also spelled Bavend), or simply the Bavandids, was an Iranian dynasty that ruled in parts of Tabaristan (present-day Mazandaran province) in what is now northern Iran from 651 until 1349, alternating between outright independence and submission as vassals to more powerful regional rulers. They ruled for 698 years, which is the second longest dynasty of Iran after the Baduspanids.

Origins
The dynasty itself traced its descent back to Bav, who was alleged to be a grandson of the Sasanian prince Kawus, brother of Khosrow I, and son of the shah Kavad I (ruled 488–531), who supposedly fled to Tabaristan from the Muslim conquest of Persia. He rallied the locals around him, repelled the first Arab attacks, and reigned for fifteen years until he was murdered by a certain Valash, who ruled the country for eight years. Bav's son, Sohrab or Sorkab (Surkhab I), established himself at Perim on the eastern mountain ranges of Tabaristan, which thereafter became the family's domain. The scholar J. Marquart, however, proposed an alternative identification of the legendary Bav with a late-6th-century Zoroastrian priest ("magian") from Ray. Parvaneh Pourshariati, in her re-examination of late Sasanian history, asserts that this Bav is a conflation of several members of the powerful House of Ispahbudhan: Bawi, his grandson Vistahm and his great-nephew Farrukhzad. She also reconstructs the events of the middle 7th century as a civil war between two rival clans, the Ispahbudhan and Valash's House of Karen, before the Dabuyid Farrukhan the Great conquered Tabaristan and subdued the various local leaders to vassalage. The Dabuyid house then ruled Tabaristan until the Abbasids subdued the region in 760.

History
It is at the time after the Abbasid conquest that the Bavandids enter documented history, with Sharwin I, in later tradition accounted the great-grandson of Surkhab I. The dynasty is commonly divided into three major branches: the Kayusiyya, named after Kayus ibn Kubad, the Arabicized name of the family's legendary ancestor Kawus son of Kavad, which ruled from 665 until 1006, when the family's rule was ended by Qabus ibn Wushmagir. Several members of the family continued to rule in various localities thereafter, giving rise to the second line, the Ispahbadhiyya, in 1073. Their capital was Sari, and their rule extended over Gilan, Ray and Qumis as well as Tabaristan, although they were mostly vassals of the Seljuqs and later of the Khwarezmshahs. The line was ended in 1210 with the murder of Rustam V, and the Khwarezmshah Muhammad II took over direct control of the region. The third line or Kinakhwariyya was established in 1237 following the Mongol invasions and the widespread chaos that prevailed, and lasted, as a vassal of the Mongols, until the final end of the dynasty in 1349.

Kayusiyya line
Following the demise of the Dabuyids, two major local dynasties were left in Tabaristan: the Bavandids in the eastern mountains and the Karenids, who also appropriated the heritage of the Dabuyid rulers, in the central and western mountain ranges. Both claimed Sasanian origin and titulature, with the Bavandids styling themselves as "kings of Tabaristan" and, like the Karenids, claiming the title of ispahbadh.

Sharwin I, along with the Karenid ruler Vandad Hormozd, led the native resistance to Muslim rule and the efforts at Islamization and settlement begun by the Abbasid governor, Khalid ibn Barmak (768–772). Following his departure, the native princes destroyed the towns he had built in the highlands, and although in 781 they affirmed loyalty to the Caliphate, in 782 they launched a general anti-Muslim revolt that was not suppressed until 785, when Sa'id al-Harashi led 40,000 troops into the region. Relations with the caliphal governors in the lowlands improved thereafter, but the Bavandid and Karenid princes remained united in their opposition to Muslim penetration of the highlands, to the extent that they prohibited even the burial of Muslims there. Isolated acts of defiance like the murder of a tax collector occurred, but when the two princes were summoned before Harun al-Rashid in 805 they promised loyalty and the payment of a tax, and were forced to leave their sons behind as hostages for four years.

After his death in 817, Sharvin was succeeded by his grandson, Shahriyar I, who managed to evict the Karenid Mazyar from his own realm. Mazyar fled to the court of the Caliph al-Ma'mun, became a Muslim and in 822/23 returned with the support of the Abbasid governor to exact revenge: Shahriyar's son and successor, Shapur, was defeated and killed, and Mazyar united the highlands under his own rule. His growing power brought him into conflict with the Muslim settlers at Amul, but he was able to take the city and receive acknowledgement of his rule over all of Tabaristan from the caliphal court. Eventually, however, he quarreled with Abdallah ibn Tahir, and in 839, he was captured by the Tahirids, who now took over control of Tabaristan. The Bavandids exploited the opportunity to regain their ancestral lands: Shapur's brother, Qarin I, assisted the Tahirids against Mazyar, and was rewarded with his brother's lands and royal title. In 842, he converted to Islam.

This period saw the rapid Islamization of the native population of Tabaristan. Although the majority accepted Sunni Islam, Shi'ism also spread, especially in Amul and the neighbouring areas of Astarabad and Gurgan. Thus, in 864, a Zaydi Alid, Hasan ibn Zayd, was invited to Tabaristan, and with support from the Daylamites took over control of the province. The Bavandids remained steadfastly opposed to the Alid dynasty throughout its existence, and Qarin's grandson Rustam I was to pay with his life for this: in 895, the Alid supporter Rafi' ibn Harthama tortured him to death. The Sunni Samanids drove out the Alids in 900, but in 914 a relative of Hasan ibn Zayd, Hasan al-Utrush, managed to drive out the Samanids, restore Alid control over the province, and force even the Bavandids and Karinids to accept his rule.

The history of the Bavandis is detailed in the works of Ibn Isfandiar and Mar'ashi which belong to the genre of local histories that gained popularity in Iran after 1000 AD. We know that they were related to the Ziyarid dynasty, through the marriage of Mardanshah, the father of Ziyar, to the daughter of one of the Bavandi kings. The prominence of the Bavandi kings apparently continued throughout the Seljuq and Mongol period. One of their greatest kings, Shah Ghazi Rustam, is reported to have seriously defeated the Ismailis who were gaining prominence in Tabaristan and to have made significant progress in consolidating power in the Caspian provinces.

After the Mongol conquest, the Bavandis continued to rule as local strongmen of Tabaristan and sometimes Dailam. Their power was finally brought down around 1350 when Kiya Afrasiyab of the Afrasiyab dynasty, themselves an offshoot of the Bavandis, managed to kill Hasan II of Tabaristan, the last of the mainline Bavandi kings.

Culture
The Bavandids stressed their lineage with the Sasanian Empire. As late as the early 13th-century, their coronation customs were assumed to go back to the remote past, as depicted thorough by the 13th-century Iranian historian Ibn Isfandiyar;

The coronation festivities lasted seven days, according to the old Iranian fashion, and included the usual feastings, rejoicings, giving of presents, while the notables and ispahbads and Bavandids assembled from all the countryside. When these congratulations were finished, on the eight day the ispahad ascended the throne, girded on the royal girdle, and confirmed the governors in their appointments, and caused the ispahbads and amirs to cast aside their mourning, and clad them in robes of honour.

Kayusiyya

 * Farrukhzad (651–665)
 * Valash (usurper, 665–673)
 * Surkhab I (673–717)
 * Mihr Mardan (717–755)
 * Surkhab II (755–772)
 * Sharwin I (772–817)
 * Shahriyar I (817–825)
 * Shapur (825)
 * Rule by the Karenid Mazyar (825–839)
 * Qarin I (839–867)
 * Rustam I (867–895)
 * Sharwin II (896–930)
 * Shahriyar II (930–964)
 * Rustam II (964–979)
 * al-Marzuban (979–986)
 * Sharwin III (986)
 * Shahriyar III (986–987)
 * al-Marzuban (987–998)
 * Shahriyar III (998)
 * al-Marzuban (998–1006)
 * Abu Ja'far Muhammad (???-1027)
 * Qarin II (1057–1074)

Ispahbadhiyya

 * Shahriyar IV (1074–1114)
 * Qarin III (1114–1117)
 * Rustam III (1117–1118)
 * Ali I (1118–1142)
 * Shah Ghazi Rustam (1142–1165)
 * Hasan I (1165–1173)
 * Ardashir I (1173–1205)
 * Rustam V (1205–1210)

Kinkhwariyya

 * Ardashir II (1238–1249)
 * Muhammad (1249–1271)
 * Ali II (1271)
 * Yazdagird (1271–1300)
 * Shahriyar V (1300–1310)
 * Shah-Kaykhusraw (1310–1328)
 * Sharaf al-Muluk (1328–1334)
 * Hasan II (1334–1349)