The mosque was founded around 1276 by the Marinid sultan Abu Yusuf, at the same time as he founded the new royal city Fes el-Jdid.[1][2][4]:310 (Fes el-Jdid was created as a fortified palace and administrative city, separate from Fes el-Bali (old Fes), from which the Marinid dynasty ruled over Morocco.[4]) Supervision of the mosque's construction was delegated to a man named Abu Abdallah ibn Abd al-Karim el-Jadudi and to the governor of Meknes, Abu Ali ibn Azraq.[5] One historical chronicle claims that the mosque's construction was funded in part by olive oil production in Meknes and that labour was provided by Christian prisoners captured in al-Andalus (Spain).[5] The mosques' construction was completed in 1278.[5] The mosque's minbar, designed by a craftsman named "Algharnati", was finished in 1279.[5] The mosque's maqsura (wooden screen shielding the sultan during prayers) and the mosque's grand chandelier were installed in 1280.[5] The mosque was only the fourth "Friday mosque" (a grand mosque where Friday sermons took place) to be founded in Fes (the others being the Qarawiyyin Mosque, the Andalusi Mosque, and the Bou Jeloud Mosque), and was meant to serve the new city.[6]:358