In 1802, the Fulani sheikh Usman dan Fodio declared jihad against the Hausa. Thirty years later his successors moved against the Yoruba.
The disunited Yoruba city-states fell rapidly before the Fulani onslaught. By 1834, the cities of Oló Iyé, Ikoyí, Offá, and Erín had been taken, with massive destruction and forced Islamization. The huge Fulani army then turned south, and in 1840 camped outside the city of Oshogbó at the great bend of the River Oshún.
Oshogbó had grown into a populous city, its population more than doubled by refugees. (Those years are still known in Yoruba as itán isá isá, the 'time of running.') As Yoruba cities go, Oshogbó was not a particularly ancient city; at this time, it had seen only 10 obás, kings.
The city had been founded by the obá Laró, who led his people there after a dispute over succession in Ibokún, and was built in pact with the goddess Oshún. Laró first planned to build in a grove on the river bank, but the goddess herself emerged from the river and told him that the grove was sacred to her, and that he must build instead on a nearby hill. If, she promised him, he would protect her grove, she would protect his city.