Since the Battle of Las Navas de Tolosa in 1212 halted the advance of the Almohads in Spain, a series of truces had kept Castile and the Almohad dominions of al-Andalus more-or-less at peace. However, a crisis of succession in the Almohad Caliphate after the death of Yusuf II in 1224 opened to Ferdinand III an opportunity for intervention. The Andalusian-based claimant, Abdallah al-Adil, began to ship the bulk of Almohad arms and men across the straits to Morocco to contest the succession with his rival there, leaving al-Andalus relatively undefended. Al-Adil's rebellious cousin, Abdallah al-Bayyasi (the Baezan), appealed to Ferdinand III for military assistance against the usurper. In 1225, a Castilian army accompanied al-Bayyasi in a campaign, ravaging the regions of Jaén, vega de Granada and, before the end of the year, had successfully installed al-Bayyasi in Córdoba. In payment, al-Bayyasi gave Ferdinand the strategic frontier strongholds of Baños de la Encina, Salvatierra (the old Order of Calatrava fortress near Ciudad Real) and Capilla (the last of which had to be taken by siege). When al-Bayyasi was rejected and killed by a popular uprising in Cordoba shortly after, the Castilians remained in occupation of al-Bayyasi's holdings in Andújar, Baeza and Martos.