In line with this imperial vision, following the establishment of their rule in Ifriqiya, the next objective was Egypt, the gateway to the Levant and Iraq, the seat of their Abbasid rivals.[2] A first invasion in 914–915 under the Fatimid heir-apparent al-Qa'im bi-Amr Allah captured the Cyrenaica, Alexandria and the Fayyum Oasis, but failed to take Fustat. Following the arrival of reinforcements from Syria and Iraq under Mu'nis al-Muzaffar, al-Qa'im retreated to Ifriqiya. In the aftermath of his retreat, Cyrenaica was lost again.[3][4]