Nephew and designated heir of Bawa, Yunfa appears to have been taught by Fulani religious leader Usman dan Fodio as a young man. Though dan Fodio helped Yunfa succeed Nafata to the throne in 1801, the two soon came into conflict over dan Fodio's proposed religious reforms. Fearing dan Fodio's growing power, Yunfa summoned him and attempted to assassinate him in person; however, Yunfa's pistol backfired and wounded him in the hand. The following year, Yunfa expelled dan Fodio and his followers from their hometown of Degel.
Dan Fodio soon called for help from other Fulani nomad groups, and declared himself the imam of a new caliphate in jihad against Gobir. A widespread uprising soon began across Hausaland, and in 1804, Yunfa appealed to rulers of neighboring city-states for aid. In December of that year, Yunfa won a major victory in the Battle of Tsuntua, in which Dan Fodio's forces were said to have lost 2,000 men, 200 of whom knew the Koran by heart.
However, dan Fodio soon launched a successful campaign against Kebbi and established a permanent base at Gwandu. In October 1808, the jihadists seized the Gobir capital of Alkalawa and killed Yunfa.