1. Mazyar's name means "protected by the yazata of the moon".

1. Mazyar's name means "protected by the yazata of the moon".
Mazyar belonged to the Qarinvand dynasty, which was descended from Sukhra, a powerful magnate from the House of Karen, who was the de facto ruler of the Sasanian Empire from 484 to 493.
However, his territories were soon invaded by the neighbouring Bavandid ruler Shahriyar I, who defeated Mazyar and forced him to flee.
Mazyar took refuge with his cousin Vinda-Umid, who betrayed him and handed him over to Shahriyar.
However, Mazyar managed to escape and reach the court of the Abbasid caliph al-Ma'mun.
Mazyar soon embraced Islam, and al-Ma'mun gave him the title of "Servant of the Commander of the Faithful" and the Muslim name of Abu'l-Hasan Muhammad.
Mazyar was granted two towns of Ruyan and Damavand in Tabaristan as his fief, and was named as the co-governor of Tabaristan with the Abbasid statesman Musa ibn Hafs.
Shapur, knowing that Mazyar planned to have him killed, sent a secret message to Musa, willing to pay him 100,000 dirhams if he would assert him as his own prisoner.
Musa, nervous of Mazyar learning of his secret communication with Shapur, asked him how he would react if Shapur converted to Islam and offered to become a client of the caliph.
Mazyar gave no answer, but had Shapur beheaded the same day, which greatly angered Musa.
Mazyar now began constructing mosques in several towns, and successfully plundered the territories of the Daylamites, and had a large number of them resettled in the border place of Muzn.
Mazyar continued to expand his influence, but his policies were regarded by the Muslims of Tabaristan as oppressive.
Mazyar refused to obey Abdallah, and the latter went before al-Mu'tasim to accuse Mazyar of infidelity and tyranny.
Mazyar tried to secure the loyalty of the noblemen of Tabaristan and imprisoned anyone he did not trust.
Mazyar named his brother Quhyar as the defender of the Qarinvand mountains, and the Bavandid Qarin I as the defender of eastern Tabaristan.
However, Tabaristan fell quickly to the Abbasid invasion: several cities were taken by surprise, while Qarin I betrayed Mazyar and agreed to aid the Abbasids in exchange for being restored as the ruler of his family's domains.