 As the military viziers effectively became heads of state, the Caliph himself was reduced to the role of a figurehead.Badr al-Jamali's son, Al-Afdal Shahanshah, succeeded him in power as vizier.In the 1040s, the Berber Zirids (governors of North Africa under the Fatimids) declared their independence from the Fatimids and their recognition of the Sunni Abbasid caliphs of Baghdad, which led the Fatimids to launch the devastating Banū Hilal invasions of North Africa.