He was captured by Uqba, put in chains and paraded throughout North Africa . But in AD 683 he succeeded in escaping and raised against his tormentors a large force of Christian Berber and Byzantine soldiers. And attacked Uqba, killing him near Biskra. After Uqba's death his armies retreated from Kairouan, which Kusaila took as his capital, and for a while he seems to have been at least in name the master of all North Africa. But his respite from battle was to be short-lived. Five years later Kusaila was killed in battle against fresh Arab forces led by a Muslim general from Damascus. This soldier was himself ambushed and put to death by Byzantine sea-raiders shortly afterwards. For a while confusion reigned, but the Awraba recognized the weakness of their position and eventually capitulated to the newly re-organized and reinforced Arab army. With the death of Kusaila, the torch of resistance passed to a tribe known as the Jerawa, who had their home in the Aurès. According to late Muslim accounts (11th century through to ibn Khaldun in the 14th century) the amir of the Muslim invaders, who was then a freed slave called Abu al-Muhajir Dinar, surprisingly invited Kusaila to meet with him in his camp. Abu al-Muhajir Dinar convinced him to accept Islam and join his army with a promise of full equality with the Arabs (678). Abu al-Muhajir was a master in diplomacy and thoroughly impressed Kusaila with not only his piety but with his high sense of respect and etiquette. Kusaila incorporated the Awraba-Sanhaja into the conquering Arab force and participated in their uniformly successful campaigns under Abu al-Muhajir. This amir was then forcibly replaced by Uqba ibn Nafi, who treated Kusaila and his men with contempt. Eventually Uqba's disrespect enraged Kusaila and provoked a plot of revenge. On the army's return from Morocco, Uqba allowed his troops to break up and go home. The remainder, about 300, were vulnerable and exhausted. On the return march to Kairouan, Kusaila joined with the Byzantine forces and organised an ambush. The Christian-Berber force, about 5000 strong, defeated the Arabs and felled Uqba at Tahudha near Biskra in 683. Kusaila now held undisputed mastery over North Africa and marched to Kairouan in triumph.