forced the besieging troops to withdraw. In 775, a Berber garrison in Coria declared allegiance to Shaqya, but Abd ar-Rahman retook the town and chased the Berbers into the mountains. In 776, Shaqya resisted sieges of his two main fortresses at Santaver and Shebat'ran (near Toledo); but in 777 he was betrayed and killed by his own followers, who sent his head to Abd ar-Rahman. Roger Collins notes that both modern historians and ancient Arab authors have had a tendency to portray Shaqya as a fanatic followed by credulous fanatics, and to argue that he was either self-deluded or fraudulent in his claim of Fatimid descent. However, Collins considers him an example of the messianic leaders that were not uncommon among Berbers at that time and earlier. He compares Shaqya to Idris I, a descendant of Ali accepted by the Zenata Berbers, who founded the Idrisid dynasty in 788, and to Salih ibn Tarif, who ruled the Bargawata Berber in the 770s. He also compares these leaders to pre-Islamic leaders Dihya and Kusaila. In 788, Hisham I succeeded Abd ar-Rahman as emir; but his brother Sulayman revolted and fled to the Berber garrison of Valencia, where he held out for two years. Finally, Sulayman came to terms with Hisham and went into exile in 790, together with other brothers who had rebelled with him. In north Africa, Sulayman and his brothers forged alliances with local Berbers, especially the Kharijite ruler of Tahert. After the death of Hisham and the accession of Al-Hakam, Hisham's brothers challenged Al-Hakam for the succession. Abd Allah crossed over to Valencia first in 796, calling on the allegiance of the same Berber garrison that sheltered Sulayman years earlier. Crossing to al-Andalus in 798, Sulayman based himself in Elvira (now Granada), Ecija, and Jaen, apparently drawing support from the Berbers in these mountainous southern regions. Sulayman was defeated in battle in 800 and fled to the Berber stronghold in Mérida, but was captured before reaching it and executed in Cordoba. In 797, the Berbers of Talavera played a major part in defeating a revolt against Al-Hakam in Toledo. A certain Ubayd Allah ibn Hamir of Toledo rebelled against Al-Hakam, who ordered Amrus ibn Yusuf, the commander of the Berbers in Talavera, to suppress the rebellion. Amrus negotiated in secret with the Banu Mahsa faction in Toledo, promising them the governorship if they betrayed Ibn Hamir. The Banu