This shrine is an urban complex built around the mausoleum of Moulay Idris II (r. 803-828), son of the founder of the Idrisid dynasty. It was the most influential religious and intellectual center until the construction of the Qarawiyyin Mosque. The currently extant mosque was built ca. 1824/1240 AH, and major renovations were carried out in 1890/1308 AH.
Among the most historically significant parts of the complex are Dar al-Qaytun (House of the Tent), the house in which Mulay Idiris I is believed to have lived when the the city of Fes was established; and the Al-'Ashraf Mosque (Mosque of the Nobles). The shrine has been an important pilgrimage destination and locale for civic ceremonies since at least the 14th c/8th c. AH.