The Marinids were a Zenata Berber dynasty that ruled Morocco from 1244 to 1465, heirs to the wreckage of the Almohad empire. Established in eastern Morocco for generations, they rose under their chief Abu Yahya, who captured Fez in 1248 and made it the Marinid capital, and under Abu Yusuf Ya'qub, who took Marrakesh from the last Almohads in 1269 and became master of Morocco. They matter because they made Fez one of the great cities of the Islamic world and fought the last great Moroccan campaigns in Spain.
Fez flowered under their patronage: the sultans founded a belt of madrasas, colleges of law and theology, whose carved courtyards remain among the glories of Moroccan art, and the city's scholars, merchants, and crafts made it the intellectual capital of the Maghreb. Art, scholarship, and trade all thrived under Marinid rule.
The Marinids declared jihad in Spain and campaigned there until the mid 14th century, helping the Nasrid kingdom of Granada hold its ground and slowing the Christian advance toward the Strait of Gibraltar, though they recaptured no lost territory. Their greatest sultan, Abu al-Hasan, seized Tlemcen in 1337 and briefly reunited much of the Maghreb, but neither he nor his successor Abu Inan could break Hafsid rule in Tunisia, and the endless campaigns depleted the dynasty's strength. The disaster came at the Battle of Rio Salado in 1340, where a Castilian-Portuguese army destroyed the Marinid host and ended Moroccan power in Spain for good; Abu Inan was murdered by his own vizier in 1358, and the sultanate slid toward anarchy.
Their power declined through internal factions and, in the 15th century, Portuguese attacks on the coast, beginning with the fall of Ceuta in 1415. In 1465 a collateral branch, the Wattasids, took over what remained, and Morocco entered a long struggle with growing European pressure along its shores.