was elected as the "Commander of the Faithful" () by his followers, marking the beginning of the Sokoto state. Usman dan Fodio then created a number of flag bearers amongst those following him, creating an early political structure of the empire. Declaring a jihad against the Hausa kings, dan Fodio rallied his primarily Fulani "warrior-scholars" against Gobir. Despite early losses at the Battle of Tsuntua and elsewhere, the forces of dan Fodio began taking over some key cities starting in 1805. The Fulani used guerrilla warfare to turn the conflict in their favor, and gathered support from the civilian population, which had come to resent the despotic rule and high taxes of the Hausa kings. Even some non-Muslim Fulani started to support dan Fodio. The war lasted from 1804 until 1808, and resulted in thousands of deaths. The forces of dan Fodio were able to capture the states of Katsina and Daura, the important kingdom of Kano in 1807, and finally conquered Gobir in 1809. In the same year, Muhammed Bello, the son of dan Fodio, founded the city of Sokoto, which became the capital of the Sokoto state. The jihad had created "a new slaving frontier on the basis of rejuvenated Islam." By 1900 the Sokoto state had "at least 1 million and perhaps as many as 2.5 million slaves", second only to the United States (which had 4 million in 1860) in size among all modern slave societies. However, there was far less of a distinction between slaves and their masters in the Sokoto state. Expansion of the Sokoto Caliphate From 1808 until the mid-1830s, the Sokoto state expanded, gradually annexing the plains to the west and key parts of Yorubaland. It became one of the largest states in Africa, stretching from modern-day Burkina Faso to Cameroon and including most of northern Nigeria and southern Niger. At its height, the Sokoto state included over 30 different emirates under its political structure. The political structure of the state was organized with the sultan of Sokoto ruling from the city of Sokoto (and for a brief period under Muhammad Bello from Wurno). The leader of each emirate was appointed by the sultan as the flag bearer for that city but was given wide independence and autonomy. Much of the growth of the state occurred through the establishment of an extensive system of ribats as part of the consolidation policy of