quality:corruption
Colonial period

In 1912, French colonial rule was instituted over Morocco following the Treaty of Fes. One immediate consequence was the 1912 riots in Fez, a popular uprising which included deadly attacks targeting Europeans as well as native Jewish inhabitants in the Mellah, followed by an even deadlier repression. The first French resident general, Hubert Lyautey, decided to move the administrative capital of the Protectorate to Rabat in 1912–1913, which has remained the capital ever since.

A number of social and physical changes took place during this period and across the 20th century. Starting under Lyautey, one important policy with long-term consequences was the decision to largely forego redevelopment of existing historic walled cities in Morocco and to intentionally preserve them as sites of historic heritage, still known today as " medinas ". Instead, the French administration built new modern cities (the Villes Nouvelles) just outside the old cities, where European settlers largely resided with modern Western-style amenities. This was part of a larger "policy of association" adopted by Lyautey which favoured various forms of indirect colonial rule by preserving local institutions and elites, in contrast with other French colonial policies that had favoured "assimilation". The Ville Nouvelle also became known as Dar Dbibegh by Moroccans, as the former palace of Moulay Abdallah was located in the same area.

The creation of the separate French Ville Nouvelle to the west had a wider impact on the entire city's development. While new colonial policies preserved historic monuments, they stalled urban development in heritage areas. Scholar Janet Abu-Lughod has argued that these policies created a kind of urban "apartheid" between the indigenous Moroccan urban areas, who were forced to remain stagnant in terms of urban development and architectural innovation, and the new, mainly European-inhabited planned cities, which expanded to occupy lands formerly used by Moroccans outside the city. This separation was partly softened, however, by wealthy Moroccans who started moving into the Ville Nouvelles during this period. By contrast, the old city (medina) of Fez was increasingly settled by poorer rural migrants from the countryside.

Fez also played a role in the Moroccan nationalist movement and in protests against the French colonial regime. Many Moroccan nationalists received their education at the Al-Qarawiyyin University and some of their informal political networks were established thanks to this shared educational background. In July 1930, the students and other inhabitants protested against the Berber Dahir, decreed by the French authorities in May of that year. In 1937, the Al-Qarawiyyin Mosque and R'cif Mosque were rallying points for demonstrations against a violent crackdown on Moroccan protesters in the nearby city of Meknes, which ended with French troops being deployed across Fes el-Bali, including at the mosques themselves. Towards the end of World War II, Moroccan nationalists gathered in Fez to draft a demand for independence which they submitted to the Allies on January 11, 1944. This resulted in the arrest of nationalist leaders followed by the violent suppression of protests across many cities, including Fez.