section_path: History/4th millenium BC – 6th century AD/Northwest Africa
section_name: Northwest Africa
paragraph_text: Northwest Africa
  
  The Maghreb and Ifriqiya were mostly cut off from the cradle of civilisation in Egypt by the Libyan desert, exacerbated by Egyptian boats being tailored to the Nile and not coping well in the open Mediterranean Sea. This caused its societies to develop contiguous to those of Southern Europe, until Phoenician settlements came to dominate the most lucrative trading locations in the Gulf of Tunis. Phoenician settlements subsequently grew into Ancient Carthage after gaining independence from Phoenicia in the 6th century BC, and they would build an extensive empire and a strict mercantile network, all secured by one of the largest and most powerful navies in the ancient Mediterranean. Carthage would meet its demise in the Punic Wars against the expansionary Roman Republic, however momentum in these wars was not linear, with Carthage initially experiencing considerable success in the Second Punic War following Hannibal 's infamous crossing of the alps into northern Italy. Their defeat and subsequent collapse of their empire would produce two further polities in the Maghreb; Numidia, which had assisted the Romans in the Second Punic War, Mauretania, a Mauri tribal kingdom and home of the legendary King Atlas, and various tribes such as Garamantes, Musulamii, and Bavares. The Third Punic War would result in Carthage's total defeat in 146 BC and the Romans established the province of Africa, with Numidia assuming control of many of Carthage's African ports. Towards the end of the 2nd century BC Mauretania fought alongside Numidia's Jugurtha in the Jugurthine War against the Romans after he had usurped the Numidian throne from a Roman ally. Together they inflicted heavy casualties that quaked the Roman Senate, with the war only ending inconclusively when Mauretania's Bocchus I sold out Jugurtha to the Romans.
  
  At the turn of the millennium, they both would face the same fate as Carthage and be conquered by the Romans who established Mauretania and Numidia as provinces of their empire, while Musulamii, led by Tacfarinas, and Garamantes were eventually defeated in war in the 1st century AD however weren't conquered. In the 5th century AD the Vandals conquered north Africa precipitating the fall of Rome. Swathes of indigenous peoples would regain self-governance in the Mauro-Roman Kingdom and its numerous successor polities in the Maghreb, namely the kingdoms of Ouarsenis, Aurès, and Altava. The Vandals ruled Ifriqiya for a century until Byzantine reconquest in the early 6th century AD. The Byzantines and the Berber kingdoms fought minor inconsequential conflicts, such as in the case of Garmul, however largely coexisted. Further inland to the Byzantine Exarchate of Africa were the Sanhaja in modern-day Algeria, a broad grouping of three groupings of tribal confederations, one of which is the Masmuda grouping in modern-day Morocco, along with the nomadic Zenata; their composite tribes would later go onto shape much of North African history.