Fodio, defeated the forces of Kebbi. He became ruler of the Gwandu Emirate, which dominated the northeast of the Sokoto Caliphate. The Sarkin Kebbi, Muhammadu Hodi, was driven from his capital and replaced by a puppet ruler, Usuman Masa. However, the Kebbawa continued to resist, and Abdullahi was unable to complete the conquest. Muhammadu Hodi fought on in the Zamfara Valley, and his successor Karari in Argungu and Zazzagawa. On Karari's death in 1831, his son Yakubu Nabame surrendered, and for 16 years lived in exile in Sokoto until Sultan Aliyu Babba allowed him to return to Argungu as a vassal of the Caliphate. In 1849 Yakubu renounced his allegiance and proclaimed himself Sarkin Kebbi. After see-saw battles, including at one time a siege of Argungu by Sokoto forces, Sultan Aliyu of Sokoto effectively recognized the independence of the Kebbi Emirate based in Argungu. Kebbi now formed a hostile wedge between Sokoto and Gwandu, and sporadic warfare continued for the next fifty years. In 1859 Yakubu's brother and successor Yusufu Mainasara was killed in battle in the dried out floodplain of the Rima River. In 1860 the Emir of Gwandu, Haliru, was killed in battle at Karakara. In 1867 the Fulani recognized the independence of Kebbi in a formal treaty. In 1875 war broke out again when the people of Fanna in the lower Rima valley decided to transfer their allegiance to Gwandu. Sarkin Kebbi Sama'ila achieved a string of successes against Gwandu between 1883 and 1903, with some severe setbacks, until the establishment of the British protectorate of Northern Nigeria finally ended the fighting. Colonial occupation On 5 August 1890 the British and French concluded an agreement to divide West Africa between the two colonial powers. Under this agreement, Britain would acquire all territories up to and including the Sokoto Caliphate, while the French would take the lands further to the north. The people of the region were not consulted. The Frenchman Parfait-Louis Monteil was given charge of an expedition to discover the northern limits of the Sokoto caliphate. Reaching Argungu in the summer of 1891, he found that the emirate was independent of Sokoto, although it was to be defeated by Sokoto in March 1892 and forced to once again become a subject state. Monteil also found little evidence of the presence claimed in the region by the British Royal Niger Company, apart from a few commercial depots