▁islands ▁off ▁its ▁coast . ▁The ▁capital ▁is ▁Rab at ▁and ▁the ▁largest ▁city ▁is ▁Cas ab lan ca . ▁Mor oc co ▁sp ans ▁an ▁area ▁of ▁ ▁and ▁has ▁a ▁population ▁of ▁over ▁ 3 6 ▁million . ▁ ▁Since ▁the ▁foundation ▁of ▁the ▁first ▁Mor oc can ▁state ▁by ▁Id ris ▁I ▁in ▁ 7 8 8 ▁AD , ▁the ▁country ▁has ▁been ▁ruled ▁by ▁a ▁series ▁of ▁independent ▁dynast ies , ▁reaching ▁its ▁z en ith ▁under ▁Al mor avid ▁and ▁Al m oh ad ▁rule , ▁when ▁it ▁sp anned ▁parts ▁of ▁I ber ia ▁and ▁north western ▁Africa . ▁The ▁Portuguese ▁Empire ▁began ▁in ▁Mor oc co ▁in ▁the ▁ 1 5 th ▁century , ▁following ▁Portuguese ▁con quest s ▁along ▁the ▁Mor oc can ▁coast , ▁found ing ▁settlement s ▁which ▁last ed ▁into ▁the ▁ 1 7 th ▁and ▁ 1 8 th ▁centuries . ▁The ▁Mar in id ▁and ▁Sa adi ▁dynast ies ▁resist ed ▁foreign ▁dom ination ▁into ▁the ▁ 1 7 th ▁century , ▁allowing ▁Mor oc co ▁to ▁remain ▁the ▁only ▁north west ▁African ▁country ▁to ▁avoid ▁Ott oman ▁occupation . ▁The ▁A la ou ite ▁dynast y , ▁which ▁rules ▁to ▁this ▁day , ▁seized ▁power ▁in ▁ 1 6 3 1 . ▁The ▁country ' s ▁strateg ic ▁location ▁near ▁the ▁mouth ▁of ▁the ▁Mediter rane an ▁attract ed ▁the ▁interest ▁of ▁Europe , ▁and ▁in ▁ 1 9 1 2 , ▁Mor oc co ▁was ▁divided ▁into ▁French