Usman dan Fodio's jihad of 1804–08 established the Sokoto Caliphate across what is now northern Nigeria, replacing the Hausa Habe kings with Fulani emirs but also producing a century of low-grade warfare on the Caliphate's eastern and southern frontiers. The Borno Empire under the Sefuwa dynasty was nearly conquered; Mohammed al-Amin al-Kanemi's defence (1809–14) created a new ruling Shehu dynasty but the empire never recovered its 16th-century reach.
By the 1890s the Sudanese warlord Rabih ibn Fadlallah had crossed from the east, sacked Kukawa (1893), killed Shehu Hashim, and ruled Borno from Dikwa until the French killed him at the Battle of Kousséri (April 1900). Borno's military and political collapse in the decade before the British arrival meant Frederick Lugard's Northern Nigeria campaign of 1900–03 met only the exhausted Caliphate and the post-Rabih wreckage of Borno. The Battle of Burmi (27 July 1903), where Caliph Attahiru was killed, was the last serious resistance.
The pattern repeats: pre-colonial wars among Africans weakened every polity Lugard would later annex. The doctrine of Indirect Rule was possible because the emirate structures were standing but exhausted — willing to swap nominal sovereignty for British protection against each other and against Rabih's heirs. See The Aro Slaving Wars and the Royal Niger Company charter.