هشام المؤيد بالله
In 1002, after the death of his father (Almanzor), Abd al-Malik (1002–1008) became the ruler of the Caliphate and led successful campaigns against Navarre and Barcelona. In 1008 Abd ur-Rahman Sanjul (1008–1009) is said to have poisoned his brother (Abd al-Malik al-Muzaffar) which led to his death in October 1008. In 1009, while Abd al-Rahman Sanchuelo was waging war against Alfonso V in León, Muhammad II al-Mahdi usurped the throne from Hisham II then held him hostage in Cordoba. In November of the same year, just months after initiating his control as the ruler of the Caliphate, Muhammad II al-Mahdi was overthrown by a primarily Berber army (that he had previously commanded, but by which he was later abandoned) which was led by Sulayman ibn al-Hakam in the battle of Alcolea. After the battle, Abd al-Malik al-Muzaffar was exiled to Toledo at which point Sulayman laid siege to Cordoba freeing Hisham II from the imprisonment that took place under the rule of Muhammad II al-Mahdi. Sulayman ibn al-Hakam was appointed to Caliph by his Berber army and maintained that position until Muhammad II al-Mahdi re-conquered the territory in May, 1010. Finally the Slavic troops of the Caliphate under al-Wahdid restored Hisham II as Caliph (1010–1013).