structural:summarization
Almoravids, Almohads and Marinids

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 unified Madinat Fas and al-ʿĀliyá 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 (Arabic term for " 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. 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. 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. During the 12th century, the city was one of the largest in the world, with an estimated population of 200,000. By 1200, Fez and Cairo had probably become the largest Muslim cities.

In 1250, Fez regained its status as the capital under the Marinid dynasty. The city reached its golden age in the Marinid period. In 1276, an anti-Marinid revolt resulted in a massacre of the Jewish community that was stopped by the intervention of the ruler Abu Yusuf Ya'qub. Following the revolt, Abu Yusuf Yaqub founded Fes Jdid as the new administrative and military centre. Under the Marinids, many of the principal monuments in the medina were built and the city established its reputation as an important intellectual centre. Between 1271 and 1357 seven madrasas were built, which are among the best examples of Moroccan architecture and some of the most richly decorated monuments in Fez.

The Jewish quarter of Fez, the Mellah, was created in Fes 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 Moroccan Jewish community had initially consisted of indigenous local Jews (known as the Toshavim) but these were joined by Western Sephardic Jews fleeing from the Iberian Peninsula (known as the Megorashim) in subsequent generations, especially after the 1492 expulsion of Jews from Spain and 1496 expulsion of Jews from Portugal.

The 1465 Moroccan revolt 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 perpetuated the structure of the Marinid state and continued its policies, but were unable to control all of Morocco. They did not contribute significantly to the physical fabric of Fez.