Sharwin I

In 760, during the reign of Sharwin's father Surkhab II, Khurshid, the head of the Dabuyid dynasty that had ruled Tabaristan since the Muslim conquest of Persia, revolted against the Abbasid Caliphate.

During the same period, Khalid ibn Barmak, the Abbasid governor of Tabaristan, left the region.

Shortly after Khalid's departure, the Karenid ruler Vandad Hormozd sent Sharwin a letter which urged him to revolt against the Abbasids.

In 805, the Abbasid caliph Harun al-Rashid visited Ray where he met Sharwin and Vandad Hormozd, who reaffirmed their submission to him and promised to pay tax.

In order to ensure their loyalty, Harun took Sharwin's grandson Shahriyar I and Vandad Hormozd's son Karin as hostages to Baghdad.