were beaten back, and reinforcements arrived from Syria under Mu'nis al-Muzaffar in April 915, greatly shoring up the Abbasid position in the country. The Fatimid army was also plagued by indiscipline and a divided command, as al-Qa'im fell out with Habasa. The latter eventually deserted the campaign and returned to Ifriqiya. Alarmed by this, al-Qa'im evacuated Alexandria hastily and without battle, leaving much of his armament and equipment behind, returning to Raqqada in 28 May 915. In his rear, Cyrenaica rose in revolt and overthrew Fatimid control; in Barqa, the entire Kutama garrison was killed. The expedition's failure rocked the Fatimid regime's very foundation and the belief in the divine mission of the imam-caliph was shaken. As a result, discontent arose, particularly among the Kutama sub-tribe of the Malusa, from whom Habasa, now hounded as a criminal, originated. His eventual capture and imprisonment led to the revolt of his brother Ghazwiyya, who had played a crucial role in securing al-Mahdi's regime up to that point, and who had recently been given charge of the entire Kutama country to the west of Ifriqiya. The revolt was quickly crushed, however, and Ghazwiyya and Habasa were executed. When their heads were brought before al-Mahdi, he is said to have exclaimed "Once did these heads enclose the East and West; and now they are contained within this basket!". Second invasion of Egypt Al-Mahdi immediately began preparations for a second assault on Egypt, starting with the recapture of Cyrenaica. This was accomplished with the surrender of Barqa after an 18-month siege, in April 917. The expedition against Egypt began on 5 April 919, when al-Qa'im, placed in sole command of the campaign, set out from Raqqada. Although Alexandria's Abbasid garrison had been reinforced, it was abandoned without battle upon the arrival of the Fatimid army. Having already acknowledged Fatimid sovereignty during the first invasion and hence now considered in revolt, the city was sacked by the Fatimid troops. Once again, the Abbasids concentrated at defending the Nile crossing at Giza. Al-Qa'im did not move against Giza, however, giving time for Abbasid reinforcements under Mu'nis al-Muzaffar to arrive. On 12 March 920, the Fatimid invasion fleet was destroyed by the Abbasid admiral Thamal al-Dulafi, crippling the invaders. Pressed for supplies, al-Qa'im repeated his manoeuvre of 914, occupying the Fayyum Oasis. Fatimid troops also succeeded in occupying much of Upper Egypt, cutting off the grain supply to