The Idrisid dynasty or Idrisids ( ') were an Arab Muslim dynasty from 788 to 974, ruling most of present-day Morocco and parts of present-day western Algeria. Named after the founder, Idris I, the Idrisids were an Alid dynasty descended from Muhammad through his grandson Hasan. Their reign played an important role in the early Islamization of Morocco and also presided over an increase in Arab immigration and Arabization in major urban centers. The Abbasid Caliphate after 750 had no more success in re-establishing control over Morocco. who traced his ancestry back to Ali ibn Abi Talib (died 661) The Awraba tribe had supported Kusayla in his struggle against the Ummayad armies in the 670s and 680s. By the second half of the 8th century they had settled in northern Morocco, where their leader Ishak had his base in the Roman town of Volubilis. By this time the Awraba were already Muslim, but lived in an area where most tribes were either Christian, Jewish, Khariji or pagan. The Awraba seem to have welcomed a Sharifi imam as a way to strengthen their political position. Idris I, who was very active in the political organization of the Awraba, began by asserting his authority and working toward the subjugation of the Christian and Jewish tribes. In 789 he founded a settlement south east of Volubilis, called Medinat Fas. In 791 Idris I was poisoned and killed by an Abbasid agent. Even though he left no male heir, shortly after his death, his wife Lalla Kanza bint Uqba al-Awrabi, bore him his only son and successor, Idris II. Idris' loyal Arab ex-slave and companion Rashid brought up the boy and took on himself the regency of the state, on behalf of the Awraba. In 801 Rashid was killed by the Abbasids. In the following year, at the age of 11 years, Idris II was proclaimed imam by the Awraba. Yahya was given Hiṣn Daī (a site probably near modern Beni Mellal). Hamza was given Walili. 'Ubayd Allah (or 'Abd Allah) was given the south, including the territory of the Lamta tribes and a town named Tamdult.
Soon after this territorial division Isa revolted against his brother Muhammad. Muhammad entrusted his other brother Umar to punish him. Umar successfully drove Isa from power, who was forced to take refuge in Chellah.thumb|170px|left|[[Idrissid dirham|Idrisid dirham, minted at al-'Aliyah (Fes), Morocco, 840 CE. The coin features the name of Ali: a son-in-law of Muhammad, the fourth Caliph, and an ancestor of the Idrisids.|alt=]]During this time Islamic and Arabic culture gained a stronghold in the towns and Morocco profited from the trans-Saharan trade, which came to be dominated by Muslim (mostly Berber) traders. The city of Fes also flourished and became an important religious center. or 921. Primary source material and contemporary scholars have described them as a Sunni Muslim dynasty. Certain contemporary academics have described them as Shi'a or Zaydi Shi'a to one extent or another, most likely because of their political affiliation. The Idrisids were political opponents of the Abbasid Caliphate. Others have criticized this claim for conflating Shia theology with a political movement in a historical period where there was no Shia theology distinct from Sunni theology in this area as of yet. Amira Bennison argues that Idrisid coinage suggests that Idris I portrayed himself as a religious leader whose legitimacy was based on his descent from Muhammad, which Bennison describes as a "proto-Shi'i or 'Alid position."
The Awraba Berbers who welcomed Idris I in Volubilis were Muʿtazila and Idris relied widely on the support of Muʿtazila Berber tribes to found his state. He is also likely to have had ties to Muʿtazila figures in the Hijaz and further east, as he was accompanied on his journey to the Maghreb by a Muʿtazila khatib from Basra who aided him in gaining the support of the tribes.
In Fes and in the town of Moulay Idriss (near Volubilis), the tombs of Idris II and Idris I, respectively, eventually developed into important religious complexes and pilgrimage sites, like the Zawiya of Moulay Idris II. Several prominent sharifian families in Fez traced their lineages to Idris I, and some of these played a role in maintaining or rebuilding the Zawiya of Idris II in the city.
The Idrisid period also played an important role in the Islamization of the region, particularly in the spread of Islam to the Berber tribes that occupied the interior territories of present-day Morocco, outside the northern coastal regions where the earliest Muslim presence was initially concentrated. From the 14th century, local writers began to portray the Idrisids as the starting point of an Islamic Maghrib al-Aqsa ("Furthest West", corresponding to present-day Morocco). The Rawd al-Qirtas, written by Ibn Abi Zar in the 14th century, is one of the best-known chronicles of this period and promoted the idea of continuity between Idrisid rule and contemporary Marinid rule, while at the same time downplaying the potential Shi'a character of Idris I.
