Among them were the Almoravids ( 1040 -- 1147 ) , who were the first to unite Morocco , as well as significant regions in West Africa , Spain and Algeria .
Among them were the Almoravids , who were the first to unite Morocco . They also united significant regions in West Africa , Spain and Algeria .