Idris I of Morocco

Idris (I) ibn Abd Allah (إدريس بن عبد الله; d. 791), also known as Idris the Elder (إدريس الأكبر), was a Hasanid and the founder of the Idrisid dynasty in part of northern Morocco, after fleeing the Hejaz as a result of the Battle of Fakhkh. He ruled from 788 to 791. He is credited with founding the dynasty that established Moroccan statehood and is regarded as the "founder of Morocco".

History
Idris was the great-grandchild of Hasan, who was the son of Fatima and Ali and grandson of the Islamic prophet, Muhammad. He was born and raised in Arabia. His paternal half-brothers Muhammad al-Nafs al-Zakiyya and Ibrahim had been killed by the Abbasids during an abortive rebellion. His brother Yahya rose in revolt in Daylam, but was forced to surrender. He was persecuted by Caliph Harun al-Rashid thereafter, and repeatedly imprisoned.

Idris himself had participated (along with Yahya) in another Alid uprising in 786, under al-Husayn ibn Ali al-Abid. After the revolt's defeat at the Battle of Fakhkh, he escaped and remained in hiding, before moving to Egypt. Assisted by the local head of the caliphal postal system, Wadih, he managed to leave Egypt and reach the Maghreb.

In 789, he arrived in Tangier before going to Walīlī, the site of the Roman Volubilis. Here his headquarters have been discovered in recent excavations conducted by the Moroccan Institute of Archaeology (INSAP) and University College London. The headquarters lies just outside the walls of the Roman town, which was then occupied by the Berber tribe of the Awraba, under Ishaq ibn Muhammad. He married Kenza, of the Awraba, fathering a son, Idris II. This event is considered a consolidation and the birth of the Idrisid dynasty, the fourth Muslim State in Morocco after Nekor (710–1019), Barghawata (744–1058), and Midrar (757–976).

Idris I conquered large parts of northern Morocco and founded the city of Fez. In 789 AD, he captured Tlemcen (in modern-day Algeria) from the Sufrite Ifranid Abu Qurra which became part of the kingdom. This succession of events prompted vengeance from the Abbasid caliph Harun al-Rashid, who sent emissaries to kill him. Idris I died in 791 in Walīlī, allegedly poisoned by the caliph's agents. His son, Idris II, was born a few months later and brought up by the Awraba under the regency of Rashid, his father's freedman (mawla) and advisor. He left Walīlī for Fes in 808. During his reign (791–828) he successfully consolidated the Idrisid state and developed Fez into a thriving capital.

Idris I's body was buried on a hill not far from Walīlī. The site of his tomb grew into a village known as Moulay Idriss Zerhoun. A zawiya (religious complex) centered around his mausoleum developed here over the centuries and remains an important religious site in Morocco today.