 But without central leadership, and with the Almohad army having suffered grievous losses at the Battle of Navas de Tolosa in 1212, a series of rebellions broke out in the Maghreb which the Almohad oligarchs were hard-pressed to contain, contributing to the eventual breakaway of Ifriqiya under the Hafsid dynasty.Yusuf II died suddenly in early 1224 – accidentally gored while playing with his pet cows.Lacking heirs, the palace bureaucrats, led by Ibn Jam‘i, quickly engineered the election of his elderly grand-uncle as the next caliph Abd al-Wahid I, as the new caliph in Marrakesh.