Short answer is Islam spread from Arabia into Africa in 600s
The Muslim conquest of the Maghreb continued the century of rapid Arab Early Muslim conquests following the death of Muhammad in 632 AD and into the Byzantine-controlled territories of Northern Africa. In a series of three stages, the conquest of the Maghreb commenced in 647 and concluded in 709 with the "Byzantine" Roman Empire losing its last remaining strongholds to the then-Umayyad Caliphate
By 642 AD, under Caliph Umar, Arab Muslim forces had laid control of Mesopotamia (638), Syria (641), Egypt (642), and had invaded Armenia, all previously territories split between the warring Byzantine and PersianEmpires, and were concluding their conquest of the Persian Empire with their defeat of the Persian army at the Battle of Nahāvand. It was at this point that Arab military expeditions into North African regions west of Egypt were first launched, continuing for years and furthering the spread of Islam.