It was founded by the Alaouite sultan Moulay Abdallah who is buried in the adjoining necropolis along with later members of the dynasty.
The mosque is located Fes el-Jdid, which was originally a royal citadel and administrative city founded in 1276 by the Marinid dynasty. Fes el-Jdid originally housed many of the sultan’s troops and it also continued to house the royal palace up to modern times.
In the 17th century the Alaouite sultan Moulay Rashid built the large Kasbah Cherarda north of Fes el-Jdid in order to house his tribal troops,[1] which in turn liberated new space in the city. This included the northwestern area of Fes el-Jdid which then became the Moulay Abdallah neighbourhood from the early 18th century onward. This is where Sultan Moulay Abdallah erected the mosque and where he himself was buried after his death.
The mosque also once had madrasa which offered initial training to less-educated students before they went on to study at the al-Qarawiyyin University. An old historic hammam is also located just west of the mosque.