The spread of Islam in North Africa came with the expansion of Arab empire under Caliph Umar, through the Sinai Peninsula. Spread of Islam in West Africa was through Islamic traders and sailors.
Islam is the dominant religion in North Africa...
https://en.wikipedia.org/wiki/Religion_in_Africa