From early Islamic times, the foundation of cities and mosques was the ruler’s prerogative. During the conquest, keen commanders begged the second caliph 'Umar b. al-Khattāb to allow them to found the garrison towns of Kufa and Basra, which he reluctantly did. As the empire grew and became more complex, the 'Abbasid caliph controlled its central parts but the dissidents of the west signalled their independence by founding their own towns and mosques without permission from the caliph.
'Abd al-Rahman I, who established the Umayyad emirate in al-Andalus (Iberia), founded the great mosque of Cordoba in 787 CE. Different Kharijite regimes founded Tahart and Sijilmasa, and Idris b. 'Abd Allah, a descendant of the Prophet's grandson, Hasan, established Fes and endowed Tlemsen with a great mosque. The chroniclers assert that the 'Abbasid caliph Harun al-Rashid viewed these acts as a challenge for power.
In subsequent centuries, the construction of buildings and the islamisation of urban space proved to be a major component in the legitimating strategies of the Umayyads of Cordoba (757-1031), and their imperial successors, the Almoravids (c. 1050-1148) and the Almohads (c. 1148-1240s). The Marinids of Fes and the Nasrids of Granada who came to power as the Almohad empire collapsed, therefore had a long tradition to adopt and adapt. They used the past in all kinds of ways including building new royal enclaves - Madinat al-Bayda’ (Fes al-Jadid) and Madinat al-Hamra’ (the Alhambra).
However, the most dramatic architectural urban innovation of the Marinids was the introduction of the madrasa (theological college) to Morocco. Although the sources allude to earlier places of learning, like the Saljuqs in the east, the Marinids patronised the madrasa on an unprecedented scale. One of the project’s research areas is the study of Marinid foundations: madrasas, other public amenities and their royal city to learn about the image the Marinid sultans wished to project to their subjects.