The Ziyarid dynasty () was an Iranian dynasty of Gilaki origin that ruled Tabaristan from 931 to 1090 during the Iranian Intermezzo period. The empire rose to prominence during the leadership of Mardavij. After his death, his brother Vushmgir and his Samanid allies led the dynasty in wrestling for control over territory against the Buyids in the early- to mid-10th century. When Vushmgir died, his sons Bisutun and Qabus fought for influence. Qabus would eventually outlive his brother and ruled the kingdom. However, Qabus was placed in exile from 980 to 998 by the Buyid ruler, Adud al-Dawla who would then dominate Tabaristan, the heartland of Ziyarid power. A succession of other rulers came to rule the kingdom with Ghaznavid support in the early 11th century. The Nizari Ismaili state invaded and ended Ziyarid rule in 1090. At its greatest extent, it ruled much of present-day western and northern Iran. During the turn of the century, the kingdom attracted many scholars, with the most notable being al-Biruni. Origins The dynasty was descended from Vardanshah, leader of the Shahanshahvand tribe, which traced its descent back to the legendary king Arghush Farhadan, who was the ruler of Gilan, and lived during the time of Kai Khosrow. Vardanshah had a son named Ziyar, who married a sister of the Gilaki king Harusindan, who bore him a son named Mardavij. Mardavij later served another Gilaki military leader named Asfar ibn Shiruya, but later betrayed the latter and conquered Tabaristan, which led to the foundation of the Ziyarid dynasty, which he named after his father. History Mardavij then began aggressively expanding his territories, killing Asfar and capturing several important cities in Iran, such as Hamadan, Dinavar, Kashan, Isfahan, Shiraz and Ahvaz from the Abbasids. He further planned to restore the Sasanian Empire through conquering Baghdad and ousting the Abbasid Caliphate, but was instead murdered in 935. After Mardavij's death, his brother and general Vushmgir was crowned as the new Ziyarid ruler in Ray. Hasan ibn Buya, one of the brothers of the Buyid ruler Ali ibn Buya, took advantage of Mardavij's death by seizing Isfahan from Ziyarid rule. The Samanids also took advantage of the opportunity, but were defeated by Vushmgir, who then wrested Gorgan from Samanid control. Reign of Vushmgir 930s–960s However, Vushmgir soon decided to acknowledge Samanid supremacy, and in 936 he also turned over Gorgan to Makan. Turning against Hasan, he retook