"During the Taifa era, the petty kings came from a variety of ethnic groups; some—for instance the Zirid kings of Granada—were of Berber origin.The Taifa period ended when a Berber dynasty—the Moroccan Almoravids—took over al-Andalus; they were succeeded by the Almohad dynasty of Morocco, during which time al-Andalus flourished.