The Hausa cultures, which as early as the 7th century AD were smelting iron ore, arose in what is today north western and north central Nigeria, to parts of Bornu. The origin of these cultures, however, is a mystery. Legend holds that Bayajidda, a traveler from the Middle East, married the queen of Daura, from who came seven sons. Each son is reputed to have founded one of the seven Hausa kingdoms: Kano, Rano, Katsina, Zazzau (Zaria), Gobir, Kebbi, and Auyo.

The seven kingdoms developed as strong trading centers, typically surrounded by a wall and with an economy based on intensive farming, cattle rearing, craft making, and later slave trading. In each Hausa state, a monarch, ruled over a network of feudal lords, most of whom had embraced Islam by the 14th century. The states maintained persistent rivalries, which at times made them easy prey to the expansion of Bornu and other kingdoms. A greater unnoticed threat to the Hausa kingdoms was the immigration of Fulani pastoralists, who came from the west to make a home in the Nigerian savanna and who permeated large areas of Hausaland over several centuries. In 1804 a Fulani scholar, Usman dan Fodio, declared a jihad (holy war) against the Hausa states, whose rulers he condemned for allowing Islamic practices to deteriorate. Local Fulani leaders, motivated by both spiritual and local political concerns, received Usuman's blessing to overthrow the Hausa rulers. 
With their superior cavalry and cohesion, the Fulani overthrew the Hausa rulers and also conquered areas beyond Hausaland, including Adamawa to the east and Nupe and Ilorin.

After the war, a loose federation of 30 emirates emerged, each recognizing the supremacy of the sultan of Sokoto. The first sultan of Sokoto was Usuman. After Usuman died in 1817, he was succeeded by his son, Muhammad Bello. Militarily and commercially powerful, the Sokoto caliphate dominated the region throughout the 19th century.