الحكم المستنصر بالله
Whilst the internal administration was left increasingly to vizir Al-Mushafi, general Ghālib ibn ʿAbd al-Raḥmān was gradually gaining influence as leader of the army in North Africa. He was chiefly preoccupied with repulsing the last Norman attacks (c. 970), and with the struggle against the Zirids and the Fatimids in northern Morocco. The Fatimids were defeated in Morocco in 974, while Al-Hakam II was able to maintain the supremacy of the caliphate over the Catholic states of Navarre, Castile and León.