Hilalian invasion of Ifriqiya

It was organised by the Fatimids with the goal of punishing the Zirids for breaking ties with them and pledging allegiance to the Abbasid Caliphs.

[3] As retaliation, the Fatimids sent devastating Banu Hilal invasions into the Maghreb to punish the Zirids and Hammadids.

[4] After devastating Cyrenica in 1050, the Banu Hilal advanced westwards towards the Zirids.

The Hilalians proceeded to sack and devastate Ifriqiya, they defeated the Zirids decisively in the Battle of Haydaran on April 14, 1052.

[6][4] As a result of the invasion, the Zirids and Hammadids were expelled to the coastal regions of Ifriqiya, with the Zirids being forced to move their capital from Kairouan to Mahdia, and their rule limited to a coastal strip around Mahdia, meanwhile the Hammadid rule was limited to a coastal strip between Ténès and El Kala as vassals of Banu Hilal and eventually being forced to move their capital from Beni Hammad to Béjaïa in 1090 following increasing pressure from Banu Hilal.