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,"Fes". Encyclopædia Britannica. 2007. Britannica Concise Encyclopedia. 3 Mar. 2007 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 p. 55 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 ("Mosque of the people from Kairouan') 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 ('Mosque of the Andalusians') 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 Khrareb (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 'Ajisa and Madinat Fas was controlled by his brother el-Ftouh. 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. In 1062, the Hammadid emir Buluggin ibn Muhammad led an expedition against the Maghrawa and briefly captured Fez for several months before leaving. He was subsequently assassinated on his return journey eastward and Fez returned to Maghrawa control afterward.
Fez under the Almoravids and Almohads (11th-13th centuries)
The Almoravids, who originated far to the south, advanced into the region near Fez in the early 1060s. In 1063, under the leadership of Yusuf Ibn Tashfin, they began a long military conquest of the region in order to defeat the Maghrawa, who were the main resistance to their rule. The last Maghrawa ruler of Fez, Mu'ansir Ibn Ziri, was a persistent obstacle. Unable to take Fez quickly, Ibn Tashfin conquered some of the surrounding forts and settlements first before refocusing on besieging the city. Mu'ansir fled Fez before the Almoravids were able to capture it in the later months of 1063. Ibn Tashfin appointed a member of his tribe as governor of the city and left a garrison of 400 Lamtuna tribesmen to guard it, then set out on further campaigns across northern Morocco. In his absence, Ibn Ziri returned, recaptured the city after a siege, and killed Ibn Tashfin's governor. The Almoravids retaliated by besieging the city and setting up a blockade. Eventually, Ibn Ziri was killed in a sortie against them, but the local Zenata continued to resist and rallied around a new leader, a man of noble lineage from Taza named Qasim Ibn Abd al-Rahman. Still unable to take the city, Ibn Tashfin kept the pressure on but chose instead to resume his conquest of the surrounding countryside and of northern Morocco, so as to eliminate resistance outside the city first. This took occupied him from 1064 until 1070.
Ibn Tashfin finally captured the city definitively on 18 March 1070 (462 AH). (Other sources give the date as 1069.) There is some contradiction and uncertainty in historical sources, however, and some historians date the final conquest to 1074 or 1075. The Almoravids sacked the city and massacred many of the Zenata, although it seems that Fez itself did not suffer much long-term damage. In the same year of this conquest, 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), later known as the Kasbah Bou Jeloud, was built at the western edge of the city (just west of Bab Bou Jeloud today) to house the city's governor and garrison. With the help of engineers from Cordoba, Ibn Tashfin also upgraded the city's water supply system by creating additional canals branching off from the main canals made earlier by Dunas Ibn Hamama. Under the patronage of the later Almoravid emir Ali Ibn Yusuf the largest expansion and renovation of the Great Mosque of al-Qarawiyyin took place between 1134 and 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.