The Marinids

Shirij Madrasa, Fez, Morocco, about 1350 AD
In 1217 AD, as the Almohad dynasty was collapsing, Sultan Abu Yusuf took over control of Morocco and founded the Marinid dynasty. The Marinid rulers were army men, cavalry riders. They made their capital city at Fez, and tried over and over to reunite the old Almohad empire by conquering their neighbors, the 'Abd al-Wazids and the Hafsids, but with no success. When the Marinids tried to attack Spain, they failed there too. But they did manage to keep control of Morocco and the trade through the Straits of Gibraltar.
One important city of the Marinid kingdom was Tangier,
which was the home of Ibn Battuta.
The Marinids ruled Morocco until 1465 AD.