their language, their system of government, and Islam, to which many of the Berbers slowly converted, mostly after the Arab rule receded. In the Islamic era the first Moroccan Muslim state, independent from the Abbasid Empire, was The Kingdom of Nekor, an emirate in the Rif area. It was founded by Salih I ibn Mansur in 710 AD, as a client state to the Rashidun Caliphate. According to medieval legend, Idris I fled to Morocco from the Abbasids' massacre against his tribe in Iraq and managed to convince the Awraba Berber tribes to break allegiance to the distant Abbasid caliphs in Baghdad. He founded the Idrisid Dynasty in 780 AD. Morocco became later a center of learning and a major power. From the 11th century onwards, a series of powerful Berber dynasties arose. Under the Almoravid dynasty and the Almohad dynasty, Morocco dominated the Maghreb, Muslim-conquered Spain, and the western Mediterranean region. In the 13th century the Merinids gained power over Morocco and strove to replicate the successes of the Almohads. In the 15th century the Reconquista ended Islamic rule in central and southern Iberia (modern day Spain + Portugal) and many Muslims and Jews fled to Morocco. Under the Saadi Dynasty, the first Moroccan dynasty initiated by ethnic Arabs since the Idrisids, the country would consolidate power and fight off Portuguese and Ottoman invaders, as in the battle of Ksar el Kebir. The reign of Ahmad al-Mansur brought new wealth and prestige to the Sultanate, and a massive invasion of the Songhay Empire was initiated.
However, managing the territories across the Sahara proved too difficult. After the death of al-Mansur the country was divided among his sons. In 1666 the sultanate was reunited by the Alaouite dynasty, who have since been the ruling house in Morocco. The organization of the state developed with Ismail Ibn Sharif. With his Jaysh d'Ahl al-Rif (the Riffian Army) he seized Tangier from the English in 1684 and drove the Spanish from Larache in 1689.
In 1912, after the First Moroccan Crisis and the Agadir Crisis, the Treaty of Fez was signed, effectively dividing Morocco into a French and a Spanish protectorate. In 1956, after forty-four years of occupation, Morocco regained independence from France and Spain as the "Kingdom of Morocco".
Population of Morocco
The area of present-day Morocco has been inhabited since Paleolithic times (at least since 200,000 BC, as attested by signs of the Aterian culture), a period when the Maghreb was less arid than it is today. In Paleolithic ages, the geography of Morocco resembled a savanna more than the present-day arid landscape. In the classical period, Morocco was known as Mauretania, although this should not be confused with the modern-day nation of Mauritania. The suggested skeletal similarities between the robust Iberomaurusian "Mechta-Afalou" burials and European Cro-Magnon remains, as well as the case for continuity of the bearers of the Iberomaurusian industry from Morocco with later northwest African populations suggested by the dental evidence should be considered. Current scientific debate is concerned with determining the relative contributions of different periods of gene flow to the current gene pool of North Africans. Anatomically modern humans are known to have been present in North Africa during the Upper Paleolithic 175,000 years ago as attested by the Aterian culture. With apparent continuity, 22,000 years ago, the Aterian was succeeded by the Iberomaurusian culture which shared similarities with Iberian cultures. The Iberomaurusian was succeeded by the Bell-Beaker culture in Morocco.
Additionally, recent studies have discovered a close mitochondrial link between Berbers and the Saami of Scandinavia which confirms that the Franco-Cantabrian refuge area of southwestern Europe was the source of late-glacial expansions of hunter-gatherers that repopulated northern Europe after the Last Glacial Maximum and reveals a direct maternal link between those European hunter-gatherer populations and the Berbers.
Jewish people (whether of Hebrew or Berber descent) h