In the early 1820s, a fierce struggle for dominance culminated in the violent death of Afonja, the powerful Aare Ona Kakanfo of Oyo. This was not merely the demise of a military leader, but a pivotal moment in the formation of the Ilorin Emirate, a new political system that would fundamentally alter the balance of power across 19th-century Yorubaland.
Afonja, based in Ilorin, challenged the faltering authority of the mighty Oyo Empire. His actions, born from imperial weakness, ignited a chain of events. These included rebellion, migration, military recruitment, and the rise of religious leadership. They ultimately reshaped the political map of Yorubaland.
Oyo’s imperial decline paved way for a power shift
Understanding Afonja requires understanding the condition of the Oyo Empire in the late eighteenth century. Oyo had for generations been one of the strongest political powers in the West African interior. Its authority depended on the Alaafin, powerful chiefs, provincial rulers and a military system capable of projecting Oyo influence over an extensive territory.
By the closing decades of the eighteenth century, the political balance was under increasing pressure. Conflicts within the ruling establishment, succession difficulties, and provincial resistance weakened the empire. Tensions between the central monarchy and powerful military figures further exacerbated its decline.
The crisis surrounding Alaafin Aole became particularly important. Afonja occupied the office of Aare Ona Kakanfo, one of the most powerful military positions in the Oyo political system. He was based at Ilorin, a strategically important settlement on the northern frontier of the empire.
His rebellion was therefore not the original cause of every problem confronting Oyo. Rather, it intensified an already serious political crisis. It also removed an important military centre from the effective control of the Alaafin.
Afonja’s defiance created a new military hub
Afonja’s independent political career at Ilorin began during the turmoil surrounding the fall of Alaafin Aole in the late eighteenth century. Historian Ismail Otukoko Salihu places Afonja’s establishment at Ilorin around 1796. His decisive rejection of Oyo authority came around 1797.
Other historical chronologies sometimes place important developments later, but Afonja’s political separation from Oyo clearly preceded Shehu Alimi’s permanent settlement at Ilorin. By the end of the eighteenth century, Ilorin had become Afonja’s principal military base.
Rather than functioning simply as an obedient commander of the Alaafin, he increasingly pursued his own military and political interests. Ilorin’s geographical position added to its importance. It stood between the northern parts of the Yoruba country and communities farther into the savanna.
As instability increased across the region, Ilorin attracted soldiers, migrants, traders, displaced people and others seeking protection or opportunities. Afonja needed military manpower to maintain his independence.
His willingness to recruit beyond the traditional Oyo military structure strengthened his forces. But it also changed the political character of Ilorin.
New military communities transformed Ilorin
Afonja recruited soldiers from different backgrounds. Hausa-speaking recruits and former slaves became particularly important among the armed men associated with his forces. Fulani, Kanuri, Nupe, and Yoruba Muslims also formed part of the increasingly diverse population around Ilorin.
The jama‘a mentioned in accounts of the period should not be treated simply as a homogeneous Fulani army sent from Sokoto. Ilorin contained several communities whose members had different ethnic backgrounds, political interests, and religious affiliations.
This diversity initially benefited Afonja, giving him a larger military following at a time when he was resisting attempts to restore Oyo authority over Ilorin. Yet the same system created a long-term problem.
Some of the groups on whom Afonja depended recognized leaders other than Afonja. Their loyalties were not based exclusively on his position as Aare Ona Kakanfo. The cultural and social dynamics of these diverse communities played a crucial role in shaping the town’s future.
Solagberu, the Muslim leader associated with Oke-Suna, possessed an influential following of his own. Other Muslim communities also maintained their own leaders. Afonja remained a dominant military figure, but Ilorin was becoming a town containing several competing centres of authority.
Shehu Alimi’s growing influence in Ilorin
Shehu Alimi was a Fulani Muslim scholar and cleric whose influence became important in Ilorin. His permanent settlement there is generally associated with around 1817. Traditions concerning earlier contacts between Alimi and Afonja also exist.
Alimi’s importance initially rested primarily on religious authority. Muslim clerics already occupied respected positions in many West African societies, where rulers and military commanders sought prayers, counsel, spiritual protection, and religious guidance.
Alimi gradually acquired considerable influence among Ilorin’s Muslim communities. His presence did not immediately turn Ilorin into an emirate. Afonja remained militarily powerful, while Solagberu and other community leaders retained influence.
Over time, however, the Muslim communities within Ilorin became increasingly significant, both politically and religiously. Alimi’s sons, particularly Abd al-Salam, eventually became central figures in the struggle over who would control the town.
Abd al-Salam and the struggle for Ilorin
Shehu Alimi died around 1823. After his death, Abd al-Salam emerged as the leading figure among the Muslim political forces in Ilorin. The rise of Abd al-Salam posed a fundamental challenge to Afonja.
Afonja had succeeded in creating an independent military stronghold, but the political structure of Ilorin remained fragmented. The soldiers, religious communities, and migrant groups that had strengthened his position did not all recognize his exclusive authority.
Conflict eventually broke out between Afonja and the increasingly powerful coalition opposing him. Accounts differ about the precise circumstances of Afonja’s death. Traditions variously describe fighting, siege, capture, and other forms of violent confrontation.
The central outcome is that Afonja lost the struggle for control of Ilorin and died during the conflict in the early 1820s. It is misleading to claim Shehu Alimi personally killed Afonja, as Alimi had already died.
This chronology is supported by important Ilorin traditions and modern historical studies. Abd al-Salam emerged from the struggle as the dominant ruler of Ilorin.
The birth of the Ilorin Emirate
Abd al-Salam became the first emir of Ilorin. Under the new political order, Ilorin developed connections with the wider Sokoto Caliphate through Gwandu. This placed the emirate within a larger Islamic political network.
It retained the diverse population from which nineteenth-century Ilorin had developed. The creation of the emirate did not erase the Yoruba population of Ilorin or reduce the settlement to a single ethnic identity.
Yoruba, Hausa, Fulani, and other communities remained important parts of the town’s population and political history. The emirate also became a significant military power.
Its armies pushed into neighboring territories, including parts of Igbomina and Ibolo. Ilorin’s influence extended towards communities in the Osun and Ekiti regions. These campaigns became closely connected with the wider wars that followed the collapse of Old Oyo.
Old Oyo’s collapse and shifting power
Afonja’s revolt was one part of the larger decline of the Oyo Empire. But the emergence of a powerful Ilorin emirate increased pressure on the remaining northern territories of Old Oyo. Old Oyo eventually fell and was abandoned in the 1830s, conventionally dated to about 1836.
Its collapse triggered enormous political and demographic change. Refugees moved southwards, new settlements expanded, and military leaders competed for control of territory and trade routes. Cities such as Ibadan grew into major centers of political and military power.
The destruction of Old Oyo therefore did not mark the disappearance of Yoruba political organization. Instead, power shifted towards new states and military centers. Ilorin became one of the most formidable forces on the northern frontier, while Ibadan rose farther south.
Their competing ambitions eventually brought them into direct confrontation. Ilorin’s armies continued pressing southwards after the fall of Old Oyo.
The Battle of Osogbo limits Ilorin’s advance
The advance towards Osogbo became one of the most important episodes in the struggle for control of the region. Around 1840, Ilorin forces campaigning in the Osogbo area faced a military intervention led by Ibadan.
The resulting Battle of Osogbo ended in a major defeat for Ilorin. The battle had consequences beyond the immediate battlefield. Ilorin’s ability to push farther into the forest region was checked.
Ibadan demonstrated that it had become a major military successor to Old Oyo. The political map of Yorubaland had therefore changed dramatically within several decades.
Oyo’s old imperial center had declined. Ilorin had emerged as an emirate on the northern frontier. Ibadan had developed into a powerful military state farther south. Other Yoruba kingdoms and towns also adjusted to a prolonged period of warfare and shifting alliances.
How Ilorin’s rise reshaped Yorubaland
The transformation of Ilorin cannot be explained by portraying Afonja as the single individual who destroyed the Oyo Empire. Oyo was already suffering from political instability, internal disputes, and weakening central authority. Afonja’s rebellion accelerated those difficulties.
It also deprived the Alaafin of an important military centre. It is equally misleading to portray Shehu Alimi simply as the commander of a Sokoto army invited by Afonja to fight his enemies.
Alimi was primarily a Muslim scholar and religious leader. The population surrounding Afonja included Hausa soldiers, former slaves, Fulani, Yoruba Muslims, and people from several other backgrounds.
Nor did Alimi become the first emir after personally killing Afonja. Abd al-Salam, Alimi’s son, emerged as the leading political figure in the new order and became Ilorin’s first emir.
The transformation was therefore gradual. Afonja’s rebellion weakened Oyo authority over Ilorin. Migration and military recruitment changed the town’s population. Muslim religious networks became increasingly influential.
Rival groups competed for political control. Abd al-Salam eventually consolidated the coalition that displaced Afonja and established a more durable government.
Afonja and the Rise of Ilorin Emirate belong to one of the most consequential periods of political transformation in nineteenth-century Yorubaland. Afonja emerged during the internal crisis of the Oyo Empire and successfully transformed Ilorin into an increasingly independent military centre.
His recruitment of soldiers from different backgrounds strengthened his revolt. But it also contributed to the growth of communities whose political loyalties did not depend entirely upon him. Shehu Alimi became an influential religious figure within this changing society.
After Alimi’s death, Abd al-Salam emerged as the dominant Muslim political leader and ultimately displaced Afonja. Ilorin subsequently became an emirate connected through Gwandu to the Sokoto Caliphate. It developed into a major regional military power.
Afonja therefore occupies a paradoxical position in Yoruba history. He succeeded in escaping the effective authority of the Oyo monarchy. But the political and military forces that helped him achieve independence eventually produced a new government that replaced his own authority.
The consequences extended far beyond Ilorin. Old Oyo collapsed, Ilorin expanded, Ibadan rose as a major military power. Nineteenth-century Yorubaland entered decades of political reorganization and warfare.
Afonja’s story shows how rapidly political alliances can change when an established state begins to lose central authority. His rebellion gave Ilorin greater independence and strengthened his personal military position. But the soldiers, migrant communities, and religious networks created new centers of power he couldn’t control.
Abd al-Salam ultimately transformed one of those coalitions into the Ilorin Emirate. The history is therefore larger than a simple story of betrayal. It concerns imperial decline, military recruitment, migration, religious influence, political organization, and the emergence of new powers from Old Oyo’s weakening.


