Mahdia campaign of 1087

As a result of the ongoing fighting and anarchy, the previously flourishing agriculture decreased and the coastal towns became more important as both centers for maritime trade as well as bases for piracy against Christian shipping.

[1] The raid had been prompted by the actions of the Zirid ruler Tamim ibn Muizz (reigned 1062–1108) as a pirate in waters off the Italian Peninsula, along with his involvement in Sicily fighting the Norman invasion.

[2] These campaigns and raids by other Arab pirates threatened the growing economic interests of the Italian maritime republics and thus provided motivation for attacking the Zirid stronghold.

[4] The attack was led by Hugh of Pisa, with military aid from Rome and the Genoese navy; the nobleman Pantaleone from Amalfi was also possibly involved, and the whole endeavour had the backing of Matilda of Tuscany.

Notably on the Latin side in the Carmen of Pisa, the De rebus gestis Rogerii et Roberti of Malaterra, the Chronica Monasterii Cassinensis of Monte Cassino and the Annales Beneventani from Benevento.