The founder of the dynasty, 'Ali ibn Buya, was originally a soldier in the service of the Daylamite warlord Makan ibn Kaki, but later changed his adherence to the Iranian ruler Mardavij, who had established the Ziyarid dynasty, and was himself related to the ruling dynasty of Gilan, a region bordering Dailam.