page_title: History of Morocco
section_title: Idrisid dynasty (789–974)
hierarchical_section_title: History of Morocco / Early Islamic Morocco (c. 700 – c. 1060) / Idrisid dynasty (789–974)
caption_attribution_description: Deutsch: Innenhof der Madrasa Bou Inaniya in Fes, Marokko
context_page_description: History of human habitation in Morocco spans since Lower Paleolithic, with the earliest known being Jebel Irhoud. Much later Morocco was part of Iberomaurusian culture, including Taforalt. It dates from the establishment of Mauretania and other ancient Berber kingdoms, to the establishment of the Moroccan state by the Idrisid dynasty followed by other Islamic dynasties, through to the colonial and independence periods.
  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.
context_section_description: The Idrisid dynasty was a Muslim polity centered in Morocco, which ruled from 788 to 974. Named after the founder Idriss I, the great grandchild of Hasan ibn Ali, the Idrisids are believed by some historians to be the founders of the first Moroccan state.
caption: The school of Al-Qarawiyyin in Fes, established by Fatima al-Fihri during the Idrisid dynasty in the 9th century.