Complex sentence: Chaos ensued with the fall of the Umayyad caliphate in 1031, but eventually Ceuta and the rest of Muslim Spain fell into the hands of successive North African dynasties.
Split into simpler sentences: Chaos ensued with the fall of the Umayyad caliphate in 1031. Eventually Ceuta and the rest of Muslim Spain were controlled by successive North African dynasties.