History of Fez

The History of Fez begins with its foundation by Idris I and Idris II at the end of the 8th century and the beginning of the 9th century CE. It initially consisted of two autonomous and competing settlements on opposing shores of what is now known as the Oued Fes. Initially inhabited by a largely Berber (Amazigh) population, successive waves of mainly Arab immigrants from Ifriqiya (Tunisia) and al-Andalus (Spain/Portugal) over time gave the nascent city an Arab character as well. After the downfall of the Idrisid dynasty, it was contested between different Zenata groups allied with either the Fatimid Caliphate or the Umayyad Caliphate of Cordoba. In the 11th century the Almoravid sultan Yusuf ibn Tashfin conquered the region and united its two settlements into what is today the Fes el-Bali ("Old Fez") quarter. Under the rule of the Almoravids and of the Almohads after them, despite losing the status of capital to Marrakesh, the city remained the economic and political center of northern Morocco and gained a reputation for religious scholarship and mercantile activity.
Fez reached its zenith in the Marinid era (13th-15th centuries), regaining its status as political capital. In 1276 the Marinid sultan Abu Yusuf Yaqub also founded a separate royal city, Fes el-Jdid ("New Fes"), just west of Fes el-Bali, where the royal palace is still located today. Numerous new madrasas and mosques were constructed across Fez, many of which survive today, while other structures were restored. During this period the Jewish population of the city grew and the "Mellah" (Jewish quarter) was formed on the south side of this new district. After the overthrow of the Marinid dynasty, Fez underwent periods of decline and prosperity and often competed with Marrakesh for political and cultural influence. The city rose again in influence during the 19th century and remained the capital of the Alaouite sultanate until 1912, when it came under control of the French Protectorate in Morocco. The French colonial regime moved the capital to Rabat, where it remains today, and Fes underwent a political decline. The French also constructed a new city, the "Ville Nouvelle", to the southwest, which grew into what is now most of the modern city of Fez.
Foundation under the Idrisids (7th-8th centuries).
The city was first founded in 789 as "Madinat Fas" on the southeast bank of the Jawhar River (now known as the Fez River) by Idris I, founder of the Idrisid dynasty. His son, Idris II, built a settlement called "Al-'Aliya" on the opposing river bank in 809 and moved his capital here from Walili (Volubilis). These settlements ("Madinat Fas" and "Al-'Aliya") would soon develop into two walled and largely autonomous sites, often in conflict with one another. The early population was composed mostly of Berbers, along with hundreds of Arab warriors from Kairouan who made up Idris II's entourage.
Arab emigration to Fez increased afterwards, including Andalusi families of mixed Arab and Iberian descent who were expelled from Córdoba in 817–818 after a rebellion against the Al-Hakam I as well as Arab families banned from Kairouan (modern Tunisia) after another rebellion in 824. The Andalusians mainly settled in "Madinat Fas", while the Tunisians found their home in "Al-'Aliya". These two waves of immigrants gave the city its Arabic character and would subsequently give their name to the districts of "'Adwat Al-Andalus" and "'Adwat al-Qarawiyyin". With the influx of Arabic-speaking Andalusians and Tunisians, the majority of the population was Arab, but rural Berbers from the surrounding countryside settled there throughout this early period, mainly in "Madinat Fas" (the Andalusian quarter) and later in Fes Jdid during the Marinid period. The city also had a strong Jewish community, probably consisting of Zenata Berbers who had previously converted to Judaism, as well as a small remaining Christian population for a time. The Jews were especially concentrated in a northeastern district of "Al-'Aliya" known as "Funduq el-Yihoudi" (near the later Bab Guissa).
The area benefitted from abundant water, and each of the two settlements was fully equipped with its own urban amenities. The first mosques of the city were the Mosque of the Sharifs (or Shurafa Mosque) and the Mosque of the Sheikhs (or al-Anouar Mosque); however, they no longer exist in their original form. The Mosque of the Sharifs became the burial site of Idris II upon his death and later evolved into the Zawiya of Moulay Idris II that exists today, while the al-Anouar Mosque has left only minor remnants. According to one of the major early sources on this period, the "Rawd al-Qirtas" by Ibn Abi Zar, in 859 the Al-Qarawiyyin Mosque was founded by Fatima al-Fihri, the daughter of a wealthy merchant. Her sister, Mariam, is likewise reputed to have founded the Al-Andalusiyyin Mosque the same year.
Upon the death of Idris II in 828, the dynasty's territory was divided among his sons. The eldest, Muhammad, received Fez, but some of his brothers attempted to break away from his leadership, resulting in an internecine conflict. Although the Idrisid realm was eventually reunified and enjoyed a period of peace under Ali ibn Muhammad and Yahya ibn Muhammad, it fell into decline again in the late 9th century.
Zenata domination and imperial rivalries (10th-11th centuries).
In the 10th century, the city was contested by the Umayyad Caliphate of Córdoba and the Fatimid Caliphate of Ifriqiya (Tunisia), who ruled the city through a host of Zenata clients. The Fatimids took the city in 927 and expelled the Idrisids definitively, after which their Miknasa (one of the Zenata tribes) were installed there. The city, along with much of northern Morocco, continued to change hands between the proxies of Córdoba and the proxies of the Fatimids for many decades. Following another successful but ephemeral Fatimid takeover of Morocco in 979 by Buluggin ibn Ziri, the forces of Al-Mansur of Córdoba managed to retake the region again, expelling the Fatimids permanently.Despite the political instability of this era, notable contributions to the city's development were made. In 956 the Qarawiyyin Mosque was significantly expanded by the local Zenata governor, Ahmed ibn Abi Said, with funds provided by Abd al-Rahman III of Córdoba. At the same time, both the Qarawiyyin Mosque and the Andalusiyyin Mosque were given new minarets, which appeared to be simplified versions of the minaret Abd al-Rahman III built for the Great Mosque of Córdoba during the same decade.
From 980 (or from 986), Fez was ruled by a Zenata dynasty from the Maghrawa tribe, who were allies of the Caliphate of Córdoba. They maintained this control even after the Caliphate's collapse in the early 11th century and until the arrival of the Almoravids. Under Zenata control Fez continued to grow even though conflicts between its two settlements, "Madinat Fas" and "Al-'Aliya", flared up during periods of political rivalry. Ziri ibn Atiyya, the first ruler of the new dynasty, had a troubled reign. However, Ibn Atiyya's descendant Dunas ibn Hamama, ruling between 1037 and 1049, was responsible for many important infrastructural works necessary to accommodate Fez's growing population. He developed much of Fez's water distribution infrastructure, which has largely survived up to the present day. According to the tenth-century geographer, Ibn Hawqal, water was flushed into the suqs every summer night to clean the ground. The water was also transported to public baths and 300 mills. The city grew quickly and by the late 900s, it had about 100,000 inhabitants.
Other structures built in his time included hammams (bathhouses), mosques, and the first bridges over the Oued Bou Khareb (mostly rebuilt in later eras). Thus, the two cities became increasingly integrated into each other: the open space between the two was increasingly filled up by new houses and up to six bridges across the river allowed for easier traffic between the two shores. A decade after Dunas, however, between 1059 and 1061, the two opposing settlements of the city were ruled separately by two rival Zenata emirs: "Al-'Aliya" was controlled by an emir named Al-Guissa and "Madinat Fas" was controlled by Al-Foutouh. Both brothers fortified their respective shores, and their names have been preserved in two of the city's gates to this day: Bab Guissa in the north and Bab Ftouh in the south.
Fez under the Almoravids and Almohads (11th-13th centuries).
In 1069–1070 (or possibly a few years later), Fez was conquered by the Almoravids under Yusuf ibn Tashfin. In the same year of this conquest, Yusuf ibn Tashfin finally unified "Madinat Fas" and "Al-'Aliya" into one city. The walls dividing them were destroyed, bridges connecting them were built or renovated, and a new circuit of walls was constructed that encompassed both cities. A kasbah (citadel) was built at the western edge of the city (just west of Bab Bou Jeloud today) to house the city's governor and garrison. Under Almoravid patronage the largest expansion and renovation of the Great Mosque of al-Qarawiyyin took place (1135–1143). Although the capital was moved to Marrakesh under the Almoravids, Fez acquired a reputation for Maliki legal scholarship and remained an important centre of trade and industry. Almoravid impact on the city's structure was such that Yusuf ibn Tashfin is sometimes considered to be the second founder of Fez.
In 1145 the Almohad leader Abd al-Mu'min besieged and conquered the city during the Almohad overthrow of the Almoravids. Due to the ferocious resistance they encountered from the local population, the Almohads demolished the city's fortifications. However, due to Fez's continuing economic and military importance, the Almohad caliph Ya'qub al-Mansur ordered the reconstruction of the ramparts. Since the city had grown in the meantime, the new Almohad perimeter of walls was larger than that of the former Almoravid ramparts. The walls were completed by his successor Muhammad al-Nasir in 1204, giving them their definitive shape and establishing the perimeter of Fes el-Bali to this day. The Almohads built the Kasbah Bou Jeloud on the site of the former Almoravid kasbah and also built the first kasbah occupying the site of the current Kasbah an-Nouar. Not all the land within the city walls was densely inhabited; much of it was still relatively open and was occupied by crops and gardens used by the inhabitants. Under Almohad rule the city grew to become one of the largest in the world between 1170 and 1180, with an estimated 200,000 people living there.
Golden age under the Marinids (13th-15th centuries).
Fez regained its political status and became recognised as the capital during the Marinid dynasty, another Berber dynasty, between the 13th and 15th century. The Marinid leader Abu Yahya besieged and captured Fez in 1248, along with other cities, after defeating an Almohad army in eastern Morocco. The traditional urban population of the city was resistant to the rule of the nomadic Marinids, however, and rebelled again in 1250, although it failed to throw off Marinid control.
In 1276, following a violent revolt, the Sultan Abu Yusuf Ya'qub built an entirely new administrative city or royal citadel to the west of the old city, on higher ground overlooking it. This became known as Fes el-Jdid ("New Fes"), while the old city became known as Fes el-Bali ("Old Fez"). The new city included the royal palace of the sultans ("Dar al-Makhzen"), the administrative offices of the state, and the headquarters of the army. The city had its own main mosque, the Great Mosque, and its own set of fortified walls and gates. Most of its outer perimeter was protected by a set of double walls; a tall inner wall with heavy square towers at regular intervals and a smaller outer wall with minor towers. Its northern entrance, at the beginning of the road to Meknes, consisted of a fortified bridge (now the Old Mechouar) over the Oued Fes. Inside, the city was further subdivided into different districts, some of which, including the Dar al-Makhzen, had walls and gates separating them from the others. Another district, initially known as "Hims" and later converted into the Jewish "Mellah", was also added to the south. In 1287 Sultan Abu Ya'qub Yusuf (son of Abu Yusuf Ya'qub) created a vast pleasure garden, known as Al-Mosara, to the north, just outside the city but encompassed by its own protective wall. The gardens were watered via an aqueduct which drew water from the Oued Fes through an enormous "noria" or water wheel, approximately 26 meters in diameter, which was located on the west side of Bab Dekkakin. Although the gardens and the water wheel have since disappeared, traces of the former aqueduct are visible in the western wall of the New Mechouar today and also in the large octagonal towers of Bab Segma, one of the former gates to the garden.
Fez reached its golden age in the Marinid period. It is from this period that the city's reputation as an important intellectual centre largely dates. The Marinid rulers established the first formal madrasas in Morocco here in the city. The madrasas became a hallmark of Marinid architecture, with its striking blending of Andalusian and Almohad traditions. Between 1271 and 1357 at least seven madrasas were built in Fez, which are considered among the best examples of Moroccan architecture and some of the most richly decorated monuments in Fez. The first of these was the Saffarin Madrasa in 1271, followed by the Sahrij Madrasa in 1321, the al-Attarine and Sba'iyin madrasas in 1323, and the Mesbahiya Madrasa in 1346. All of these madrasas were built near the Qarawiyyin or Andalusiyyin mosques and were designed to compliment those older institutions, in particular by providing housing for students from outside the city. Another madrasa was also built near the Great Mosque of Fes el-Jdid in 1320, though this center never succeeded in rivaling the older educational centers in Fes el-Bali. The only truly independent madrasa (for a time) was the large Bou Inania Madrasa, commissioned by Sultan Abu Inan and completed in 1355, which also served as its own Friday mosque and was located in the western part of Fes el-Bali.
Meanwhile, many scholars consider that the high point of the Qarawiyyin as an intellectual and scholarly center was in the 13th-14th centuries, when the curriculum was at its broadest and its prestige had reached new heights after centuries of expansion and elite patronage. Among the subjects taught around this period or shortly after were traditional religious subjects such as the Qur'an and "Fiqh" (Islamic jurisprudence) as well as other sciences like grammar, rhetoric, logic, medicine, mathematics, astronomy and geography.
Ibn Khaldun, the famous historian and philosopher, spent time in Fez after 1354. He started as the secretary of Sultan Abu Inan but subsequently became involved in the intrigues of Marinid dynastic politics, spending time in jail at the end of Abu Inan's reign. Ibn Battuta also passed through the city on his way to Sijilmasa in the 14th century and described it in his writings. Ibn al-Khatib, the Andalusi poet and writer, also spent time here following his Nasrid master Muhammad V into exile for a few years between 1358 and 1362. After becoming embroiled in political intrigues in Granada he fled to North Africa again and was accused of heresy, eventually being put on trial in Fez and killed while in prison in 1375; his body was reportedly burnt in front of Bab Mahrouk and was buried in the nearby cemetery.
The Jewish quarter of Fez, the "Mellah", was created in Fes el-Jdid at some point during the Marinid period. The exact date and circumstances of its formation are not firmly established, but many scholars date the transfer of the Jewish population from Fes el-Bali to the new Mellah to the 15th century, a period of political tension and instability. In particular, Jewish sources describe the transfer as a consequence of the "rediscovery" of Idris II's body in the heart of the city in 1437, which caused the surrounding area – if not the entire city – to acquire a "holy" ("haram") status, requiring that non-Muslims be removed from the area. The Jewish community had initially consisted of indigenous local Jews but these were joined by Sephardic Jews from the Iberian Peninsula (known as the "Megorashim") in subsequent generations, especially after the 1492 expulsion of Jews from Spain. The ensuing waves of Spanish/Andalusi Jews migrating to Fez and North Africa increased the Jewish population in the city and also altered the community's social, ethnic, and linguistic makeup. The influx of migrants also revitalized Jewish cultural activity in the following years, while splitting the community along ethnic lines for many generations. The "Megorashim" of Spanish origin retained their heritage and their Spanish language while the indigenous Moroccan "Toshavim", who spoke Arabic and were of Arab and Berber heritage, followed their own traditions. Members of the two communities worshiped in separate synagogues and were even buried separately. It was only in the 18th century that the two communities eventually blended together, with Arabic eventually becoming the main language of the entire community while the Spanish (Sephardic) "minhag" became dominant in religious practice.
The 1465 Moroccan revolt in 1465 overthrew the last Marinid sultan. In 1472 the Wattasids, another Zenata dynasty which had previously served as viziers under the Marinid sultans, succeeded as rulers of Morocco from Fez. They faithfully (but for a large part unsuccessfully) continued Marinid policies.
Decline under the Saadians (16th and early 17th centuries).
In the 16th century the Saadians (or Saadis) rose to power in southern Morocco and challenged the Wattasids. In the meanwhile, the Ottoman Empire came close to Fez after the conquest of Algeria in the 16th century. In January 1549 the Saadian sultan Mohammed ash-Sheikh took Fez and ousted the last Wattasid sultan Ali Abu Hassun. They later retook the city in 1554 with Ottoman support, but this reconquest was short-lived and later that same year the Wattasids were decisively defeated in the Battle of Tadla by the Saadians. The Ottomans would try to invade Morocco after the assassination of Mohammed ash-Sheikh in 1558, but were stopped by his son Abdallah al-Ghalib at the battle of Wadi al-Laban north of Fez. Hence, Morocco remained the only North-African state to remain outside Ottoman control.
After the death of Abdallah al-Ghalib a new power struggle would emerge. Abd al-Malik, Abdallah's brother, enlisted Ottoman support and ousted his nephew Abu Abdullah from power in 1576. The latter would flee to Portugal where he asked king Sebastian of Portugal for help to regain his throne. This would lead to the Battle of Alcacer Quibir where Abd al-Malik's army would defeat the invading Portuguese army with the support of his Ottoman allies, ensuring Moroccan independence. Abd al-Malik himself also died during the battle and was succeeded by Ahmad al-Mansur.
The Saadians, who used Marrakesh again as their capital, did not lavish much attention on Fez, with the exception of the ornate ablutions pavilions added to the Qarawiyyin Mosque's courtyard during their time. It was likely during the Saadian period that the former royal gardens of the Marinids, the Mosara, fell into disuse and began to fade. Perhaps as a result of persistent tensions with the city's inhabitants, the Saadians built a number of new forts and bastions around the city which appear to have been aimed at keeping control over the local population. They were mostly located on higher ground overlooking Fes el-Bali, from which they would have been easily able to bombard the city with canons. These include the Kasbah Tamdert, just inside the city walls near Bab Ftouh, and the forts of Borj Nord ("Borj al-Shamali") on the hills to the north, Borj Sud ("Borj al-Janoub") on the hills to the south, and the Borj Sheikh Ahmed to the west, at a point in Fes el-Jdid's walls that was closest to Fes el-Bali. These were built in the late 16th century, mostly by Sultan Ahmad al-Mansur. Two other bastions, Borj Twil and Borj Sidi Bou Nafa', were also built along Fes el-Jdid's walls south of Borj Sheikh Ahmed. The Borj Nord, Borj Sud, and these bastions (sometimes referred to as the "bastioun" in Arabic) of Fes el-Jdid are the only fortifications in Fez to demonstrate clear European (most likely Portuguese) influence in their design, updated to serve as defenses in the age of gunpowder. Some of them may have been built with the help of Christian European prisoners of war from the Saadians' victory over Portuguese at the Battle of the Three Kings in 1578.
After the long and impressive reign of Ahmad al-Mansur, the Saadian state fell into civil war between his sons and potential successors. Fez became a rival seat of power for a number of brothers vying against other family members ruling from Marrakesh and both cities changed hands multiple times until the internecine conflict finally ended in 1627. During this time, the inhabitants of the city had violent confrontations with the Chraga, an Arab tribe which the Saadians had installed in the surrounding countryside as a garrison force (known as a "guich" or "army" tribe). In 1611 the population of the city revolted and even massacred many of the Chraga in apparent retaliation against crimes committed by some of their members. Despite the reunification of the realm after 1627, the Saadians were in full decline and Fez had already suffered considerably from the repeated conquests and reconquests during the conflict. As the Saadian sultanate collapsed, both the city and the wider country descended into relative anarchy. The two shores of the city, the "'Adwat al-Qarawiyyin" and "'Adwat al-Andalusiyyin" (the latter now also known simply as "al-'Adwat"), fell into rivalries reminiscent of the city's early history, while new rivalries developed between different clans within the western ("Qarawiyyin") shore. Fes el-Jdid, which was the center of the official government, also struggled against Fes el-Bali, the old city. In 1649 the city was conquered by the Dala'iyya, a Berber federation from the Middle Atlas which won control over much of central Morocco at the time. The city was not receptive to them either, however, and for a brief period in 1651 they rebelled and invited Muhammad ibn Muhammad al-Sharif, one of the early Alaouite sultans, to take control of the city.
Early Alaouite period (17th and 18th centuries).
It was only when the true founder of the future Alaouite state, Moulay Rashid, took Fez in 1666 that the city saw a revival and became the capital again, albeit briefly. Moulay Rashid set about restoring the city after a long period of neglect. He built the Kasbah Cherarda (also known as the Kasbah al-Khemis) to the north of Fes el-Jdid and of the Royal Palace in order to house a large part of his tribal troops. He also restored or rebuilt what became known as the Kasbah an-Nouar, which became the living quarters of his followers from the Tafilalt region (the Alaouite dynasty's ancestral home). For this reason, the kasbah was also known as the Kasbah Filala ("Kasbah of the people from Tafilalt"). Moulay Rashid also built a large new madrasa, the Cherratine Madrasa, in 1670. Upon his death in 1672 he was buried in the Mausoleum of Sidi Harazem, in the southern cemetery of the city outside Bab Ftouh. 
After his death Fez underwent another dark period. Moulay Isma'il, his successor, apparently disliked the city – possibly due to a rebellion there in his early reign – and chose nearby Meknès as his capital instead. He also frequently imposed heavy taxes on the city's inhabitants and sometimes even forcibly transferred parts of its population to repopulate other cities in the country. Nonetheless, he did restore or rebuild some major monuments in the city, such as the Zawiya of Moulay Idris II. 
After Isma'il's death things only worsened as Morocco plunged into anarchy and decades of conflict between his sons who vied to succeed him. Fez suffered particularly from repeated conflicts with the Udayas (or Oudayas), a "guich" tribe (vassal tribe serving as a garrison and military force) previously installed in the Kasbah Cherarda by Moulay Isma'il. Sultan Moulay Abdallah, who reigned intermittently during this period and used Fez as a capital, was initially welcomed in 1728–29 as an enemy of the Udayas, but relations between him and the city's population quickly soured due to his choice of governor. He immediately built a separate fortified palace in the countryside, Dar Dbibegh, where he resided instead. For nearly three more decades the city remained in more or less perpetual conflict with both the Udayas and the Alaouite sultans.
Starting with the reign of Moulay Muhammad ibn Abdallah, between 1757 and 1790, the country stabilized and Fez finally regained its fortunes. Although its status was partly shared with Marrakesh, it remained the capital of Morocco for the rest of the Alaouite period up to the 20th century. The Udayas, who had been a burden on the population of Fez, became the main challenge to the new sultan's power, and in 1760 Muhammad ibn Abdallah was forced to march with an army to Fez where he arrested their leaders and destroyed their contingents, killing many of their soldiers. In the aftermath the sultan created a new, much smaller, Udaya regiment which was given new commanders and garrisoned in Meknes instead.
There was a brief period of disorder under Moulay Yazid (ruled 1790–1792) and Moulay Slimane (ruled 1792–1822), with the sultans in Fez losing control of most of the rest of Morocco between 1790 and 1795. The reign of Moulay Yazid was especially disastrous in the city. The Udayas tribe was brought back to garrison the city. Most notably, during these two years he forced the entire Jewish community to move to an open area next to the Kasbah Cherarda, north side of Fes el-Jdid. The Mellah was occupied by tribal troops allied to the sultan, its main synagogue was replaced by a mosque, and the district itself was permanently reduced in size. It was only after the Moulay Yazid's death that the chief Muslim "qadi" (judge) of Fez ordered the Mellah to be restored to the Jewish community, along with the demolition of the mosque built by Yazid's troops.
Otherwise, however, the city benefitted from a long era of relative peace. It remained a major economic center of the region even during troubled times. The Alaouites continued to rebuild or restore various monuments, as well as to expand the grounds of the Royal Palace a number of times. The sultans and their entourage also became more and more closely associated with the elites of Fez and other urban centers, with the "ulama" (religious scholars) of Fez being particularly influential. After Moulay Slimane's death powerful Fassi families became the main players of the country's political and intellectual scene. After another episode of troubles in 1820, his successor Abd al-Rahman expelled the Udayas from Fez permanently in 1824.
Prosperity and growth in the 19th and early 20th centuries.
The Tijani Sufi order, started by Ahmad al-Tijani (d. 1815), had its spiritual center in Fez after al-Tijani moved here from Algeria in 1789. The order spread quickly among the literary elite of North West Africa and its "ulama" had significant religious, intellectual, and political influence in Fez and beyond. Until the 19th century the city was also the only manufacturing center of fezzes (also known as the "tarboosh"). The fortunes of the Jewish community also improved considerably in the 19th century when the expansion of contact and trade with Europe allowed the Jewish merchant class to place themselves at the center of international trade networks in Morocco. This also led to a greater social openness and a shift in tastes and attitudes, especially among richer Jews, who built luxurious residences in the upper Mellah. Likewise, rich Muslim families and elites built their own grand mansions, especially in the garden districts of "al-'Uyun" in southwestern part of Fes el-Bali. Examples from the late 19th century and early 20th century include the Dar Moqri, Dar Glaoui, Dar Mnebhi and Dar Jama'i. 
The last major change to Fez's topography before the 20th century was made during the reign of Moulay Hasan I (1873-1894), who finally connected Fes el-Jdid and Fes el-Bali by building a walled corridor between them. Within this new corridor, between the two cities, were built new gardens and summer palaces used by the royals and the capital's high society, such as the Jnan Sbil Gardens and the Dar Batha palace. Moulay Hassan also expanded the old Royal Palace itself, extending its entrance up to the current location of the Old Mechouar while adding the New Mechouar, along with the Dar al-Makina, to the north. This had the consequence of also splitting the Moulay Abdallah neighbourhood to the northwest from the rest of Fes el-Jdid.
Fez played a central role in the "Hafidhiya", the brief civil war that erupted when Sultan Abd al-Hafid challenged his heavily Europe-allied brother Abdelaziz for the throne. A few years later the French Colonel Charles Émile Moinier arrived in Fez in 1911 and established itself at Dar Dbibegh. Moinier established himself in Fez and protected Sultan Abd al-Hafid from threats, including the pretension of Ahmed al-Hiba, son of Ma al-'Aynayn, to the sultanate.
French colonial rule (1912–1956).
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. Fez and its Dar al-Makhzen ceased to be the center of power in Morocco as the capital was moved to Rabat, which remained the capital even after independence in 1956.
A number of social and physical changes took place at this period and across the 20th century. Starting under French resident general Hubert 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 existence today of a "Ville Nouvelle" ("New City") alongside a historic "medina" in Fez was thus a consequence of this early colonial decision-making. 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 French administration did still build some new structures in the old city, often emulating the local Moroccan style, such as the now iconic Bab Bou Jeloud gate in 1913.
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, it also had other consequences in the long-term by stalling urban development in these heritage areas. Scholar Janet Abu-Lughod has argued that these policies created in Morocco a kind of urban "apartheid" between the indigenous Moroccan urban areas – which were forced to remain stagnant in terms of urban development and architectural innovation – and the new planned cities which were mainly inhabited by Europeans and 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 Al-Qarawiyyin's students and other inhabitants participated in protests 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 some of the rallying points for demonstrations in response to a violent crackdown on Moroccan protesters in the nearby city of Meknes, which ended with French troops being deployed across Fes el-Bali and 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.
After independence and up to present-day (after 1956).
After Morocco regained its independence in 1956 many of the trends begun under colonial rule continued and accelerated during the second half of the 20th century. Much of Fez's bourgeois classes moved to the growing metropolises of Casablanca and the capital, Rabat. The Jewish population was particularly depleted, either moving to Casablanca or emigrating to countries like France, Canada, and Israel. Although the population of the city grew, it did so only slowly up until the late 1960s, when the pace of growth finally accelerated. Throughout this period (and up to today) Fez nonetheless remained the country's third largest urban center. Between 1971 and 2000, the population of the city roughly tripled from 325,000 to 940,000. The "Ville Nouvelle" became the locus of further development, with new peripheral neighbourhoods – with inconsistent housing quality – spreading outwards around it. In 1963 the University of Al-Qarawiyyin was reorganized as a state university, while a new public university, Sidi Mohamed Ben Abdellah University, was founded in 1975 in the "Ville Nouvelle". In 1981, the old city, consisting of Fes el-Bali and Fes Jdid, was classified as a UNESCO World Heritage Site.
During this period, however, Moroccans were also subject to serious social inequalities and economic precarity, particularly under the repressive reign of King Hassan II (known as the Years of Lead). Austerity measures led to several riots and uprisings across other cities during the 1980s. In 1990 the population of Fez broke into protest and rioting in turn, led by university students and youths. The events began with a strike called to demand an increase to minimum wage and other measures. The death of one of the students further inflamed protests, resulting in buildings being burned and looted, particularly symbols of wealth such as the "Hôtel des Mérinides", a luxury hotel overlooking Fes el-Bali and dating to the time of Lyautey. While the official death toll was 5 people, the New York Times reported a toll of 33 people and quoted an anonymous source claiming the real death toll was likely higher. The government denied reports that the deaths were due to the intervention of security forces and armored vehicles.
Today Fez remains a regional capital and one of Morocco's most important cities. Many of the former notable families of Fez still make up a large part of the country's political elite. It is also a major tourism destination due to its historical heritage. In recent years efforts have been underway to restore and rehabilitate the old medina, ranging from the restoration of individual monuments to attempts to rehabilitate the Fez River.