Upon his father's death, Anushirvan became the Ziyarid ruler. His ascension was confirmed by Mahmud of Ghazna, in exchange for a promise that tribute would continue to be paid by the Ziyarids. In 1032, however, Anushirvan's army chief and maternal relative Abu Kalijar ibn Vayhan effectively took control of the state. Mahmud's successor Mas'ud recognized this change upon being assured that the tribute would still be paid, and in 1033 married one of Abu Kalijar's daughters. The Ziyarid tribute was not regularly paid, however, leading to a Ghaznavid invasion in 1035. Mas'ud's army marched as far as Royan, forcing Abu Kalijar to flee. When the Ghaznavids left, however, Abu Kalijar regained control of the state and made peace with Mas'ud, promising to pay the tribute.
Sometime after 1040, Anushirvan managed to arrest Abu Kalijar and resumed the rule on his own. In 1041 or 1042, however, the Seljuks under Toghril Beg conquered Gurgan. Toghril Beg installed a former Ghaznavid commander, Mardavij ibn Bishui as governor of the region. Mardavij eventually made peace with Anushirvan, causing the latter to accept Toghril as his overlord. The Ziyarids would remain as Seljuk vassals until the last quarter of the 11th century. Anushirvan died in 1050, and was succeeded by cousin Keikavus.