been useful in checking both Castile and the Banu Ashqilula, weakened as both sides were concerned about losing each other's support after the succession. Alfonso was also interested in reconciling with some of the rebels. Muhammad II then entered into negotiations with Alfonso—if he could secure Castile's alliance, he would not need to worry about losing the support of the rebels. In late 1273, he and some of the rebel leaders visited Alfonso at his court in Seville, where they were welcomed with honour. Alfonso agreed to Granada's demands—to end his support for the Banu Ashqilula—in exchange for Muhammad's promise to be Alfonso's vassal, to pay 300,000 maravedís each year in tribute, and to end his co-operation with the rebels. However, once the payment was made, Alfonso reneged on his part of the bargain, maintained his support for the Banu Ashqilula and pressed Muhammad to grant them a truce. Marinid expeditions against Castile Frustrated by Alfonso, Muhammad sought help from the Marinids, ruled by Abu Yusuf Yaqub. While Alfonso was away on a journey to meet Pope Gregory X, leaving his realm under his heir and the regent Ferdinand de la Cerda, Muhammad sent envoys to the Marinid court. Abu Yusuf had expressed interest in fighting the Christians in Spain since 1245, and now, having gained control of the former Almohad capital of Marrakech and unified most of Morocco, he had the power and the opportunity to do so. In April 1275 Abu Yusuf mobilised an army which included 5,000 cavalry under the command of his son, Abu Zayyan Mandil. Three months later Abu Zayyan crossed the Strait of Gibraltar, landed at Tarifa and took over the town. Soon the governor of Algeciras seceded from Granada and yielded his town to Abu Zayyan. The Marinid prince established a beachhead between Tarifa and Algeciras, and began raiding Castilian territory up to Jerez. Amid the landings, Muhammad II attacked the Banu Ashqilula in Málaga on June 1275, but he was repulsed. Ferdinand de la Cerda marched to meet the Muslim forces, but he died on 25 July 1275 in Villareal, leaving Castile with uncertain leadership. With the beachhead established and the Castilian territories reconnoitred, Abu Yusuf sent more troops across, including his own household troops, ministers, officials and North African clerics. Abu Yusuf himself crossed to Spain on 17 August 1275. He then met with Muhammad and the leader of the Banu