Banu al-Rand Revolt, was a revolt in Gafsa against the Almohad Caliphate, which led to a Banu al-Rand restoration, until Gafsa was captured again.
Background After the Hilalian invasion of Ifriqiya, Abdullah ibn al-Rand, governor of Gafsa, declared his independence with the city as its Emir, paid tribute with Arabs to keep them away, and reorganised the region to prevent corruption, he was succeeded by his son al-Mu'tazz, who conquered Qamudah, his reign was peaceful and harmonious, but after he became old and blind, his grandson Yahya ibn Tamim took control over the state, making his grandfather nothing but a puppet, and during his days, the Almohad conquest of Ifriqiya, Abdullah ibn Abd al-Mu'min captured Gafsa and exiled Banu al-Rand to Bejaia, where al-Mu'tazz died in 1162 at the age of 114. Yahya, ibn khaldoun, 1867, p.170Mac Gluckin, de slane, 1847, p. 213
Nu'man ibn 'Abd al-Haqq al-Hintati was appointed governor of Gafsa. After three years, he was dismissed and replaced by Maymun ibn Ajana al-Kansifi. Maymun was then dismissed and replaced by 'Imran ibn Musa al-Sanhaji, who mistreated the people, so they then contacted Ali ibn al-Aziz ibn al-Mu'tazz, also known as an Ali al-Tawil, a poor tailor residing in Bejaia, and asked him to come and take control of the city.
Revolt The population of Gafsa revolted, and overthrew the Almohad governor, 'Imran ibn Musa al-Sanhaji, and killed him, then al-Aziz ibn al-Mu'tazz came, taking contro over the city, and pledged allegiance to the Abbasids naming himself "Al-Nasir li din al-Nabi".
Upon learning of the rebellion, the caliph Abu Yaqub Yusuf embarked on a long campaign towards Gafsa. According to Ibn Sahib al-Salat, he departed from Marrakech on 15 March 1180 with a large army. Upon reaching Tlemcen, command of the expedition was taken over by the caliph’s son, Sayyid Abu Yusuf Yaqub. After spending some time in Bejaïa, he reached the Djerid region, where all the sheikhs of the Riyah tribe pledged allegiance to him. Following this event, the Almohad forces bombarded Gafsa and took control of the city, forcing al-Tawil to flee. This brought the rebellion to an end and allowed the Almohades to establish their control over Gafsa in the winter of 1181.Abd El Fath Fathi, Abu Hassan Choukri, 2011, p. 207–208
But according to Ibn Khaldun, Abu Yaqub Yusuf sent his brother, Abu Zakariya, who besieged Gafsa in 1168 until he was victorious, he captured Ali ibn al-Aziz and sent him to Marrakesh with his family and possessions. Ali then ruled Salé until his death.
References
Sources