 Berber groups were involved in the rebellion of Umar ibn Hafsun from 880 to 915.Ibn Hafsun rebelled in 880, was captured, then escaped in 883 to his base in Bobastro.There he formed an alliance with the Banu Rifa' tribe of Berbers, who had a stronghold in Alhama.