Born to a Zoroastrian family native to Gilan, Mardavij sought to establish a native Iranian Zoroastrian empire akin to the Sasanian Empire that had been conquered in the 7th century by the Rashidun Caliphate and subsequently ruled by Muslims. He first started his career by joining the army of his kinsman Asfar ibn Shiruya.
Mardavij, a member of a native Gilan Zoroastrian family, aimed to create an Iranian Zoroastrian empire similar to the Sasanian Empire, which had been conquered in the 7th century and later ruled by Muslim dynasties. He started his military career under his cousin Asfar ibn Shiruya.