History: The Idrisid Dynasty
The Idrisid Dynasty was named after its founding leader, and is a very interesting part of the history of Morocco. Idris I, or Idris ibn Abdallah, was a descendant of Ali ibn Abi Talib, and his wife was Prophet Muhammad’s daughter. The combination of their ancestry made them a target for Abbasid persecution, as well as his brother and cousin being active members of the revolts and dedicated anti-Abbasid supporters. He narrowly avoided the Massacre of Fakh, which took place in 786, and fled to Morocco. Zaydite missionaries traveled to Maghreb ahead of Idris I, and by the time of his arrival the Awraba Berbers of Volubilis were prepared to name him their leader.
As their imam, he took a wife from the Awraba Berber of Volubis tribe, who gave him a son, Idris II. Idris I and his descendants ruled the Idrisid Dynasty from 788 to 985, and he was viewed as the leader of the entire region. Historians do not consider them to be Arabs at all, as their descendants, the Hammudid (Rulers of Cordoba), were referred to as Zenata Berbers. Many view the Berbers as the ultimate power of Morocco.
Even though the establishment of Fez is attributed to the reign of Idris II, it appears that this area was developed in two phases. The first phase was founded by Idris I, with his son taking over and developing the eastern bank, which was named Madinat Fas, as found on ancient coins that were struck between the years 801 to 805. During the year 808, the bank opposite Madinat Fas was established as al-Aliyya. The Idrisid Dynasty was able to extend their land into the Atlas Mountains and became one of the largest powers in Morocco. By the time Muhammad ibn Idris took charge of the dynasty, the land was divided into eight states, each ruled by a brother, and struggles between the states led to weakening of the Idrisid Dynasty as one ruling power.
Continuous attacks by the Fatimids later wore down the Idrisid Dynasty, driving them out of Fez. Help came in the form of the Caliphate of Cardoba and allowed the Idrisid Dynasty to hold onto Fez until 926, after which they completely withdrew out of Fez and moved to the Rif Mountains. Unfortunately the dynasty made the fatal decision to join forces with the Fatimids, and the Caliphate of Cardoba did not take kindly to this decision, executing them in 985.