الحكم المستنصر بالله
On the death of Al-Hakam II, the heir, Hisham II, was underage, and the position of hajib was occupied by a Berber named al-Mushafi. However, General Ghālib ibn ʿAbd al-Raḥmān and Muhammad Ibn Abī ‘Āmir formed an alliance, and in 978 they overthrew al-Mushafi and his sons and other family members, who had received offices. Al-Mushafi was imprisoned for five years before being killed, and his family was stripped of property and titles.