Topic summary
History of Morocco

The history of human habitation in Morocco extends back to the Lower Paleolithic, with some of the earliest known evidence found at Jebel Irhoud. Much later, Morocco formed part of the Iberomaurusian cultural sphere, represented by sites such as Taforalt. The region later saw the establishment of Mauretania and other ancient Berber kingdoms, followed by the foundation of the Moroccan state under the Idrisid dynasty and the rise of successive Islamic dynasties, culminating in the establishment of the Alawi dynasty, which has ruled Morocco since the 17th century and remains the country's reigning dynasty today.
Archaeological evidence has shown that the area was inhabited by hominids at least 400,000 years ago. The recorded history of Morocco begins with the Phoenician colonization of the Moroccan coast between the 8th and 6th centuries BCE, although the area was inhabited by indigenous Berbers for some two thousand years before that. In the 5th century BCE, the city-state of Carthage extended its hegemony over the coastal areas. They remained there until the late 3rd century BCE, while the hinterland was ruled by indigenous monarchs. Indigenous Berber monarchs ruled the territory from the 3rd century BCE until 40 CE, when it was annexed to the Roman Empire. In the mid-5th century CE, it was overrun by Vandals, before being recovered by the Byzantine Empire in the 6th century.
The region was conquered by the Muslims in the early 8th century CE but broke away from the Umayyad Caliphate following the Berber Revolt of 740. Half a century later, the Moroccan state was established by the Idrisid dynasty. The Idrisids were succeeded by the Almoravid dynasty, the Almohad dynasty, the Marinid dynasty and the Wattasid dynasty. The Saadi dynasty then ruled Morocco from the 16th to the 17th century, followed by the Alawi dynasty from 1667 onward.