Down near the Straits of Gibraltar, however, the Hammud brothers began their own plan to restore strong central control of the Caliphate under their leadership. The Hammud brothers claimed Arab descent and believed that their lineage would allow them to stand apart from the local quarrels and disputes of the region thus enabling them to appeal to a broad array of Muslims. Ali ibn Hammud had little respect for Sulayman and patiently waited for the most opportune time to initiate a revolution. As so, at the outset of his rule in Ceuta, Ali ibn Hammud postured himself as loyal to Sulayman. Beginning in late 1013, however, he declared himself independent of Ceuta and stated that he would undertake to free Hisham II, who’s ultimate disposition remained a mystery. Ali ibn Hammud also opportunistically accepted and promoted a narrative circulated by supporters of the ruling Umayyads that Hisham II, uncertain about his own fate during the siege of Córdoba, named Ali ibn Hammud as his heir-presumptive. The narrative also purportedly claimed that Hisham II sought to have his death avenged by Ali ibn Hammud. Then in 1014 when
Mujahid al-Amiri, the Muslim ruler of the Balearic Islands, began his expeditions in the Mediterranean, Ali ibn Hammud crossed the Straits of Gibraltar and captured the city of Málaga. In al-Andalus over the next 18 months, Ali ibn Hammud consolidated his forces in part by joining with his brother and marched on Córdoba. Along the way he met little resistance as the Berber fiefdoms were more interested in their respective domains then they were in defending Sulayman. Advancing toward Córdoba, Ali ibn Hammud gathered supporters and in the summer of 1016 he entered the capital city. On 17 June, 1016, Ali ibn Hammud defeated Sulayman’s Berber militias in Córdoba. In an organized fashion the palace was immediately searched for Hisham II. Ultimately a body was exhumed and declared to be Hisham II. Sulayman was charged with the murder of the caliph and shortly thereafter beheaded. Approximately two weeks later on 3 July 1016, Ali ibn Hammud was proclaimed caliph. ==Reign and downfall==