 Ibn Abi Amir called on the Berbers he had lived with in 973–974 to come help him.His Berber ally Jafar ibn Hamdun crossed the straits with his army, whereas Ghalib allied with the Kingdom of Navarre.These armies fought several battles, in the last one of which Ghalib was killed, bringing the civil war to an end.