 When Abd al-Rahman went on an expedition against King Alfonso V of León (February 1009), the citizens of Córdoba rose against him.They were led by Muhammad II al-Mahdi, a member of the Umayyad dynasty.Muhammad II al-Mahdi removed his relative Hisham II from the throne, became the new caliph and destroyed Abd al-Rahman's residence, al-Madina al-Zahira ("the flourishing city").