Marinid
The Marinids were a Zenata Berber dynasty of the Banu Marin, nomads who entered eastern Morocco. Under Abd al-Haqq I the family rose early in the thirteenth century, and after the Almohad collapse of 1212 they overcame their old masters, taking Fez and finally Marrakesh in 1269.
Abu Yusuf Yaqub founded New Fez in 1276 and intervened in Spain for Granada. The adventure ended with defeat at the Río Salado in 1340 and the loss of Algeciras in 1344. Under Abu al-Hasan they took Tlemcen in 1337 and overran Hafsid lands to Tripoli in 1347, briefly uniting most of the Maghreb.
After Abu Inan's strangulation by his vizier in 1358, sultans became ministerial puppets; Marrakesh broke away in 1359 and Portugal seized Ceuta in 1415. The related Wattasids held the regency from 1420, and Abd al-Haqq II's murder in the Fez revolt of 1465 gave them power. Fez under the Marinids was a golden age of Maliki learning, studded with madrasas.