Alfonso died in 1284, and was succeeded by Sancho. Sancho was friendly towards Granada and pulled back the Castilian troops, while Muhammad declared his vassalage to him. In 1286 Abu Yusuf died and was succeeded by his son Abu Yaqub. At the beginning of his reign Abu Yaqub was more preoccupied with domestic affairs, and so withdrew his forces from the Iberian campaign. In 1288 Abu Yaqub offered the Banu Ashqilula lands in North Africa. The clan took up the offer and emigrated "en masse" from Granadan territory.