In the 13th century the Marinids, a Berber dynasty, ruled what is now this country with Fez as their capital
These 
include the Idrisids (established from 790 in Fez) and the Aghlabids (ruling from 
800 ...