A native of the Shirvan region, Shirvani belonged to a Shia Muslim family. The region was then ruled by the Shirvan Khanate, a dependency of Zand Iran.
Shirvani, originating from the Shirvan region, had a Shia Muslim lineage. At that time, the region was governed by the Shirvan Khanate, which was a subordinate state to Zand Iran.