Muhammad ibn Idris

Upon the death of his father in 828, acting on the advice of his grandmother he divided the Idrisid realm among his older brothers, keeping only the capital, Fes, for himself.

[2] This weakened his authority and immediately gave rise to civil war and the decline of the Idrisid dynasty.

[2] When the fourth brother, Isa, ruler of Wazeqqur, revolted against Fes, Muhammad sought the assistance first of Qasim, ruler of Tangier, but was refused.

He then turned to Umar, ruler of the Rif Mountains, who defeated both Isa and Qasim, receiving in return the governorship over Tangier.

[2] The descendants of Umar and of Qasim would later rival for the leadership of the Idrisid realm after Muhammad's line went extinct.