When Qatari, however, demanded his conversion to Islam on Kharijite terms he joined forces with the army sent by al-Hajjaj, and Qatarl was killed, according to a legendary report by the Ispahbad himself in single combat. Under the pressure of new Arab attacks the Ispahbad agreed to pay tribute but succeeded in keeping the Muslims out of the country. When the 'Abbasid revolutionary army reached Ray in 131/748 the Ispahbad Khurshid readily followed the invitation of Abu Muslim to transfer his allegiance and pay the tribute to the new power. The Masmughan of Damavand rejected a similar demand and repelled the 'Abbasid troops sent against him.
After the execution of Abu Muslim by the caliph al-Mansur the Ispahbad Khurshid supported the Zoroastrian Sunbadh who rose in revolt in 137/754-5 claiming revenge for Abu Muslim and offered him shelter in Tabaristan after his defeat by the caliph's troops. Sunbadh was killed, however, by a relative of the Ispahbad to whom he refused to show respect. Al-Mansur attempted to overthrow Khurshld by appointing and crowning a cousin of his as Ispahbad. As this expedient failed to shake the position of Khurshld, a settlement was reached under which Khurshld promised to pay a heavy tribute. But in 141/759 al-Mansur ordered war against the Ispahbad. Within two years Tabaristan was conquered by the concerted action of the generals Abu'l-Khasib, Khazim b. Khuzaima, Abu 'Aun b. cAbd-Allah, Rauh b. Hatim, and 'Umar b. al-'Ala'.
The last-named also took Ruyan and, even further west, Kalar and Chalus which became the Muslim border towns towards the country of Dailaman. The Ispahbad fled to Dailaman and gathered an army of Dailamites and Gilites threatening a counterattack. But when his wives and children were captured by the Muslims he despaired and poisoned himself in 144/761. Damavand too was conquered by the Muslims, probably a few years later.
Tabaristan henceforth was ruled by Muslim governors residing in Amul. Their first task was to secure the Muslim domination over the newly subdued territories. Though the nobility was generally left unharmed, some prominent Zoroastrian leaders were killed during the first years of the occupation. The third governor, Abu'l-'Abbas al-Tusi, c. 146/763 settled garrisons (masdlih) ranging in strength between two hundred and one thousand Arab and Persian, chiefly Khurasanian, loyalists {abnd9 ) to the 'Abbasid cause in more than forty towns and strategic spots from Tamlsha in the east to Chalus and Kalar in the west. The mountains of Tabaristan, however, continued to elude the control of the conquerors.
They were ruled by members of two families claiming, like the Dabuyids, illustrious descent in the Sasanian past. The eastern mountain range, later known as the Sharvin mountains, was the domain of Sharvin of the house of Bavand. His ancestor Bav was said to be a grandson of Ka'us, son of the Sasanian king Kavadh, and to have come to Tabaristan at the time of the flight of Yazdgard III before the Arab conquerors. Bav is, on the other hand, the name of a magus, and it has been suggested that the family was descended from a prominent Zoroastrian priest of Ray at the turn of the sixth century. The seat of the Bavandids was in Firim on mount Shahriyarkuh. The central mountain range was ruled by Vindadhhurmuzd of the house of Qarinvand who resided near Damavand and in Lafur. A younger brother of Vindadhhurmuzd, Vindaspagan, held sway over the western mountains and resided in Muzn at the border of Dailaman.
The Qarinvand allegedly were descended from Sokhra, the minister of Kavadh, whose son Karen was granted parts of Tabaristan by Anushirvan. Perhaps more reliable is a different account stating that they had been installed in their domains by the Dabuyids a century before. Vindadhhurmuzd and his successors considered themselves as heirs of the Dabuyids and assumed their titles Gllgilan and Ispahbads of Khurasan. The Bavandids in this period were addressed as kings of Tukharistan and probably also claimed the title of Ispahbad.