Fez (Ar. Fās, Fr. Fès) is a second/eighth-century imperial city of Morocco, situated at 4° 54' W, 34° 6' N. The history of Fez mirrors much of the standard history of Morocco (al-Maghrib al-Aqṣāʾ). It was founded by the country's legendary patriarch, Idrīs b. ʿAbdallāh (r. 172-5/789-91), a descendant of the prophet Muḥammad and eponym of the country's first dynasty, the Idrīsids (r. 172-375/789-985); every dynasty or invader thereafter either made the city the capital or subjugated it,