Kayumarth I

Kayumarth I (also spelled Gayumarth I or Kayumars I; ) was the ruler ("ustandar") of the Baduspanids from 1394 to 1453, with a three-year interruption. An active expansionist ruler, his kingdom experienced a resurgence during his long reign, which included the reconquest of Rustamdar. He was often at odds with his suzerain, the Timurid ruler Shah Rukh (). After his death, a dynastic struggle followed, which resulted in his kingdom being split up by his sons Iskandar IV and Ka'us II, in Kojur and Nur respectively.
Background.
The Baduspanids were a local Iranian dynasty that ruled the mountainous district of Rustamdar in western Mazandaran, a region on the Caspian coast of northern Iran. It was founded in 665 by its eponym Baduspan I, a son of Gil Gavbara, the first Dabuyid ruler of Gilan and western Mazandaran. Gil Gavbara was the great-grandson of Jamasp, King of Kings () of the Sasanian Empire from 496 to 498/9 and a brother of the Kavad I (). Since the rise of the Shahriyarid line of the Baduspanid family, established by Shahriyar III ibn Jamshid (), the Baduspanids wielded the pre-Islamic title of "ustandar", originally an administrative title of provincial governors under the Sasanians.
During the time of Kayumarth, the Caspian region of northern Iran was under the control of several local dynasties who often intermarried, fell into dispute over lands, and intervened in each other's affairs. He was a distant member of the Baduspanid royal family; he was a son of Bisutun and grandson of Gustahm, who was the son of the Baduspanid ruler Taj al-Dawla Ziyar (). The Baduspanids had been temporarily removed from power after the "ustandar" Adud al-Dawla Qubad () was defeated and killed in 1381 by the Mar'ashis, who incorporated Rustamdar into their own domains. 
In 1390, the Mar'ashis installed Sa'd al-Dawla Tus (a son of Taj al-Dawla Ziyar) on the Baduspanid throne in Rustamdar to challenge the Afrasiyabid prince Iskandar-i Shaykhi who accompanied the Turco-Mongol ruler Timur (), who intended to conquer Mazandaran. However, Tus secretly corresponded with Iskandar-i Shaykhi, and eventually joined the forces of Timur in 1392. The following year (1393), Timur dislodged the Mar'ashis and conquered Mazandaran. He split up their territories between rival families and Timurid governors. Tus managed to convince him to spare the Mar'ashi family, while Iskandar-i Shaykhi was appointed governor of Mazandaran. In 1394, Tus was killed by his nephew Iskandar ibn Gustahm ibn Ziyar. It remains uncertain whether Iskandar succeeded him as "ustandar" or not. According to the 15th-century historian Zahir al-Din Mar'ashi, Kayumarth succeeded him, but the modern historian Wilferd Madelung doubts this, stating that Kayumarth "must have been too young at this time."
First reign.
When Iskandar-i Shaykhi left his realm in 1399/1400 to join Timur's Azerbaijan expedition, the latter deprived the Baduspanids of most of their holdings by sending his troops to administer most of Rustamdar. Kayumarth's holdings were now restricted to that of the castle of Nur. After his return to the castle of Firuzkuh in , Iskandar-i Shaykhi staged a rebellion against Timur, who sent a force to subdue him. The commanders of the force requested the help of Kayumarth, due to his reputation as a rival of Iskandar-i Shaykhi. However, they had him deceived by capturing and sending him to Iskandar-i Shaykhi as a bargaining chip to convince him to cease his rebellion. However, Iskandar-i Shaykhi instantly had Kayumarth released, who left for the court of Timur's son at Shiraz in Fars. There he was well-received, and also converted to Twelver Shia Islam. 
Iskandar-i Shaykhi was defeated and killed in 1403/4 at Shir-rud-duhazar, and Timur appointed the Mar'ashi Sayyid Ali Sari as the governor of Amul, with his brother Ghiyath al-Din as his second-in-command. After Timur's death in 1405, the Mar'ashis started to gradually assert their rule over their former territories. Meanwhile, Kayumarth was briefly imprisoned, but a few months after escaped and disguised himself amongst a group of travelling "qalandars". When he reached Nur, he killed its Timurid commander, and subsequently restored Baduspanid rule in Rustamdar with the assistance of its inhabitants.
Second reign.
Timur's son Shah Rukh () reinstated Timurid rule over Mazandaran in 1407, and confirmed the rule of Kayumarth. Regardless, Kayumarth would for several years cautiously lend support to rulers rebelling against Shah Rukh, but after Shah Rukh secured a victory in Fars in 1414/15, Kayumarth fully accepted his suzerainty. Kayumarth was an energic expansionist ruler during his long rule, with his kingdom experiencing a resurgence. He convinced his subjects to convert to Twelver Shi'ism, which resulted in closer links with the likewise Twelver Mar'ashi rulers of Mazandaran. In , he sent soldiers to aid Ghiyath al-Din against Sayyid Ali Sari, who had been acknowledged by Shah Rukh. Ghiyath al-Din was, however, defeated, and fled to Kayumarth. In 1413, he sent an army to help Sayyid Ali Amuli recapture Amul from Sayyid Ali Sari. However, after Ali Sari's death in 1417, he made peace with latters son Sayyid Murtada (), acknowledging his rule. A marriage was arranged between Kayumarth's daughter and Sayyid Murtada's son, while Kayumarth's son Ka'us married a daughter of the first Mar'ashi ruler Mir-i Buzurg. Sayyid Murtada also ceded Kayumarth some marchland.
In 1420, following the request of Sayyid Murtada, Kayumarth sent a force to help him against a revolt led by Sayyid Nasir al-Din. He made incursions into the domains of Ilyas Khwaja (a vassal of Shah Rukh) to the south of the Alborz, attacking Simnan and Bistam, while capturing the castle of Tabarak, near Ray. Ilyas protested to Shah Rukh about this, but Kayumarth successfully kept the latter content by sending him extravagant gifts. Shah Rukh eventually sent a force under Abd al-Ali Bakavli to warn Kayumarth and aid Ilyas if required. However, Bakavli was soon killed near Shamiran by Kayumarth's forces. Kayumarth instantly released the prisoners of war, including a son of Ilyas. He implored Shah Rukh for forgiveness, which he received in return for promising to contain himself in the future. 
Kayumarth soon fell into conflict with the Kar-Kiya dynasty of eastern Gilan. The death of their chief ruler Sayyid Rida Kiya in March–April 1426 had led to internal strife. Kayumarth took advantage of this by plundering several areas in the region. He seized Alamut from the Ismaili imam Khudawand Muhammad, briefly occupying it for over a year until it was taken by the Kar-Kiya ruler Sayyid Kiya Muhammad. In 1427, Kayumarth resumed his incursions, attacking Tonekabon and Alamut. A year later (1428), Kiya Muhammad retaliated, laying waste to the lands of Taleqan and Qasran. Kayumarth followed this back with another attack on Tonekabon, burning the residence of its ruler Sayyid Da'ud Kiya.
Kiya Muhammad now started to search for allies. He soon made an alliance with Sayyid Murtada and Ilyas Khwaja in a common cause against Kayumarth. In 1429, they attacked Kayumarth from all sides, defeating and routing his forces. Wounded, Kayumarth fled to Kojur and then Natel. His realm was split up by the victors, who gave it to his relatives Malik Nawzar (a grandson of Tus) and Malik Husayn (a great-grandson of Jalal al-Dawla Iskandar), whose fathers had been killed at his instigation. Kayumarth went to Shah Rukh in Herat, where he convinced him to help him. At the behest of Shah Rukh, Kiya Muhammad returned Kayumarth's territories to him, with the exception of Taleqan and the castle of Falis. They were first to be returned to him later in 1441/2 by Kiya Muhammad's son Mahdi Kiya, when he looked for support against his brother Nasir Kiya. In 1436/7, Kayumarth supported Zahir al-Din Mar'ashi in his struggle against Sayyid Muhammad (a son of Sayyid Murtada) over the control of Sari. Zahir al-Din was soon defeated, and together with his ally Sayyid Kamal al-Din Amuli took refuge in Kayumarth's realm. However, Kayumarth soon made an agreement with Sayyid Muhammad, in which he agreed to withdraw his support the latters enemies in return for control over Mianrud. He later helped Murtada ibn Rida al-Din repel Kamal al-Din from Amul, but withdrew after the latter counterattacked. He protected Murtada ibn Rida al-Din until he took over Amul after Kamal al-Din's death in 1445.
Kayumarth died in 1453. After his death, a dynastic struggle followed, which resulted in his kingdom being split up by his sons Iskandar IV and Ka'us II, in Kojur and Nur respectively. The Baduspanid dynasty was never to be united again, with the two branches ruling separately until they were eventually deposed in 1590s by the Safavid monarch of Iran, Abbas the Great ().
Religious activities.
Under Kayumarth, Twelver Shia Islam was declared the official religion of his realm. In the rural parts of Rustamdar, he had several shrines constructed on top of the tombs of Shia scholars and descendants of the prophet. The Arabic and Persian inscriptions on their walls demonstrate Kayumarth's devotion to the religion. Later in his reign, he is known to have sent a certain scholar named Abd al-Rahim ibn Ma'ruf Rustamdari () to study Shi'i jurisprudence with other religious scholars abroad. Ten years later, the latter returned to Rustamdar, shortly after the death of Kayumarth. He is known to have later composed a religious volume under the patronage of Ka'us II.