[4] He used his prestige as a descendant of Muhammad to forge an alliance with local Berber tribes (in particular the Awraba) in 789 and quickly became the most important religious and political leader in the region.
[3][4] Once Idris II came of age and officially took over his position as ruler in 803, he continued his father's endeavors and significantly expanded the authority of the new Idrisid state.
[9] Although the town became a site of pilgrimage early on, after Idris II it was quickly overshadowed by Fes, which became the most important city of the region.
[5] The popularity of Idris I and his son as Muslim "saints" and figures of national importance was not constant throughout Morocco's history, with their status declining significantly after the end of Idrisid influence in the 10th century.
[9][4] The Almoravids, the next major Moroccan dynasty after them, were hostile to the cult of saints and other practices judged less orthodox under their stricter views of Islam.
[10][4]: 180 During this time, the annual moussem (religious festival) in August, celebrating Moulay Idris I, was instituted and began to take shape.
[9] Moulay Ismail, the powerful and long-reigning Alaouite sultan between 1672 and 1727, ordered the existing mausoleum to be demolished and rebuilt on a grander scale.
[2] In 1822, the Alaouite sultan Moulay Abderrahman (Abd al-Rahman), purchased another property adjoining the mausoleum in order to rebuild the mosque on an even bigger and more lavish scale.
[7] The Sentissi Mosque and the Mausoleum-mosque of Sidi Abdallah el Hajjam are also located near the top of the Khiber hill.
[7][13] The minaret is covered in a background of green tiles with white Kufic-style Arabic letters spelling out a surah from the Qur'an.