The conquest of the Maghreb by the Rashidun and Umayyad Caliphates commenced in 647 and concluded in 709, when the Byzantine Empire lost its last remaining strongholds to Caliph Al-Walid I. The North African campaigns were part of the century of rapid early Muslim conquests.
By 642 AD, under Caliph Umar, Arab Muslim forces had taken control of Mesopotamia (638 AD), Syria (641 AD), Egypt (642 AD), and had invaded Armenia (642 AD), all territories previously split between the warring Byzantine and Sasanian empires, and were concluding their conquest of Sasanian Persia 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.