the Berbers, placing ʿAlī over Ceuta, Tangier, and the adjacent coast, and al-Qāsim over Algeciras.
Al-Ḥumaydī relates: Al-Mustaʿīn kept roaming with the Berbers, spreading corruption, looting, and laying cities and villages waste with the sword; the Berbers who accompanied him spared neither young nor old. He eventually gained control of Córdoba. At that point ʿAlī ibn Ḥammūd al-Idrīsī set his sights on the caliphate, entered into secret correspondence, and a great many people responded and pledged allegiance to him. He crossed from Ceuta into al-Andalus, received the oath from the governor of Málaga, brought the leading notables under his sway, and marched on Córdoba. Al-Mustaʿīn prepared his son Muḥammad ibn Sulaymān to fight him; the armies met, Muḥammad was routed, and Ibn Ḥammūd pressed on, entering Córdoba at once. He captured al-Mustaʿīn, slaughtering him with his own hand after taking him captive, and slew his father al-Ḥakam as well, an old man in his eighties. This occurred in Muḥarram of the year 407 AH, and with it the Marwānid dynasty came to an end in all of al-Andalus (1).
Al-Mustaʿīn was a cultured man and a poet; he lived a little over fifty years. Among his famous verses are these (2):
Marvel of marvels: the lion quails before the point of my spear,
yet I quail before a glance from languid-lidded eyes (3).