Fez
The Marinid age ended in upheaval. The rediscovery of Idris II's body in the heart of the old city in 1437 made the district around it holy ground, and Jewish tradition holds that the Jews were then moved out to a new quarter, the Mellah, beside Fās al-Jadīd. A revolt overthrew the last Marinid sultan in 1465, and the Wattasids, once his viziers, ruled from Fez after 1472 without adding much to it. The Saadis, who took the city for good in 1554, governed from Marrakesh and ringed Fez with forts that seem aimed less at outside enemies than at its own restless people.
After Ahmad al-Mansur's death in 1603 his sons fought over the kingdom, and Fez changed hands again and again until 1627. Revival came in 1666 with Moulay Rashid, the first Alaouite sultan, who restored the neglected city and built the Kasbah Cherarda for his tribal troops, but his successor Moulay Ismail disliked Fez and ruled from Meknes. Its standing as a city of learning outlasted these swings of fortune, and in 1789 the Sufi master Ahmad al-Tijani settled here from Algeria, making Fez the spiritual centre of an order that spread quickly across North and West Africa.