The Idrisids were an Arab Zaydi-Shia dynasty of Morocco, ruling from 788 to 974. Named after the founder Idriss I, the grandchild of Hasan ibn Ali. The founder of the dynasty was Idris ibn Abdallah, who traced his ancestry back to Ali ibn Abi Talib and his wife Fatimah, daughter of the Islamic prophet, Muhammad. After the Battle of Fakhkh, near Mecca, between the Abbasids and a Shiite party, Idris ibn Abdallah fled to the Maghreb and he first arrived in Tangier, the most important city of Morocco at the time, and by 788 he had settled in Volubilis. The powerful Awraba Berbers of Volubilis took him in and made him their imam, the Awraba tribe was originally from the Tlemcen region and 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, 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 heir, shortly after his death, his concubine Lalla Kanza bint Uqba al-Awrabi, bore him his only son and successor. Idris loyal Arab ex-slave and companion Rashid brought up the boy and took on himself the regency of the state, in 801 Rashid was killed by the Abbasids. In the following year, at the age of 11 years, even though he had spread his authority across much of northern Morocco, as far west as Tlemcen, Idris I had been completely dependent on the Awraba leadership. Idris II began his rule with the weakening of Awraba power by welcoming Arab settlers in Walili, thus he transformed himself from a protégé of the Awraba into their sovereign. The Awraba leader Ishak responded by plotting against his life with the Aghlabids of Tunisia, Idris reacted by having his former protector Ishak killed, and in 809 moved his seat of government from the Awraba dominated Walili to Fes, where he founded a new settlement named Al-Aliya. Idriss II developed the city of Fez, established earlier by his father as a Berber market town, here he welcomed two waves of Arab immigration, one in 818 from Cordoba and another in 824 from Aghlabid Tunisia, giving Fes a more Arab character than other Maghrebi cities. Muhammad himself came to rule Fes, with nominal power over his brothers. During this time Islamic and Arabic culture gained a stronghold in the towns and Morocco profited from the trans-Saharan trade, the Idrisids were principally rulers of the towns and had little power over the majority of the countrys population. The Idrisid family in turn was heavily berberised, with its members aligning itself with the Zenata tribes of Morocco, already in the 870s the family was described by Ibn Qutaybah as being berberised in customs. By the 11th century this process had developed to such an extant, in the 11th century the Hammudid family arose among these Berber Idrisids, which was able to gain power in several cities of northern Morocco and southern Spain
Idrisid coin, minted at al-'Aliyah, Morocco, 840 CE.
Fountain at Place Nejjarine, Fez, dating from the Idrisid dynasty.
Idrisid state, around 820 CE, showing its maximal extent.