The Fulani were mostly Muslims, as were the rulers of most of the states in the region. The Islam of the rulers of these states was quite fragile, however, and they quickly reverted to the nationalistic animist religions when threatened. Over the seventeenth and eighteenth centuries the Fulani began to launch scattered uprisings against rulers who were oppressing them. These established a number of small, and usually briefly lived, emirates in the west of the Sahel.
The most powerful states in the region were the city-states of Hausaland. They had large Fulani populations, who were generally considered second class citizens. Over the centuries, however, the Hausa and Fulani had become quite integrated. One of the more marginal Hausa states was that of Gobir. Poor and on the periphery of Hausaland, it was ruled by a remnant of the defunct Songhai empire. This rule was noted for its despotism towards both the Fulani and the Hausa peasants.
Degel was defended, but unable to stand up to the army of Yunfa - dan Fodio and his followers retreated to Gudu. From exile dan Fodio called for a jihad against oppressors throughout the region that became the Fulani War. As a result, dan Fodio was joined by large numbers of Fulani and also many Hausa, this sparked a general uprising in Hausaland and most of the region's governments quickly fell. Dan Fodio was proclaimed as ruler of the new caliphate.
The new empire was organized into a series of emirates that were loosely controlled by dan Fodio. Under him the empire was split into two divisions, one ruled by his brother, the other by his son. In 1815 dan Fodio retired from the Sultanate and the empire passed to his son Muhammed Bello. He built up the new capital at Sokoto, turning it into a major centre. The empire in the nineteenth century is often referred to as the Sokoto Caliphate. Dan Fodio's brother Abdullahi dan Fodio continued to rule in the west, and this position, known as the emirate of Gwandu, was passed to his heirs but remained subordinated to Sokoto.
In addition to its military prowess, the empire became known for its scholarship. Bello, Abdullahi, and dan Fodio were all considered great scholars and despite ruling such a vast state, all three continued to produce a sizable output of poetry, and texts on religion, politics, and history. While scholarship continued in the empire after Bello's death it became divorced from political life. Over time, the empire also became far more Hausa in character, with the Hausa language becoming the official language.
The empire continued to be an economic success. Hausaland, now unified, reached a level of unprecedented prosperity and the region remained safe from raids by Saharan nomads.
While the Sultan of Sokoto was paramount, the Emirs controlling the other cities, especially Kano, steadily increased in power during the nineteenth century. In 1893 a crisis of the succession saw the rulers of Kano rise to preeminence.