So Islam became the religion of the elites in West Africa, which meant that the Muslim kings were trying to extend their power over largely non-Muslim populations that worshipped traditional African gods and spirits. 