 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.The crisis in the Almohad Caliphate, however, remained unresolved.In 1228, a new Almohad pretender, Abd al-Ala Idris I 'al-Ma'mun', decided to abandon Spain, and left with the last remnant of the Almohad forces for Morocco.