Country in North Africa
Morocco, officially the Kingdom of Morocco, is a country in the Maghreb region of North Africa. It overlooks the Mediterranean Sea to the north and the Atlantic Ocean to the west, and has land borders with Algeria to the east, and the disputed territory of Western Sahara to the south. Morocco also claims the Spanish exclaves of Ceuta, Melilla and Peñón de Vélez de la Gomera, and several small Spanish-controlled islands off its coast. It has a population of approximately 37 million. Islam is both the official and predominant religion, while Arabic and Berber are the official languages. Additionally, French and the Moroccan dialect of Arabic are widely spoken. The culture of Morocco is a mix of Arab, Berber, African and European cultures. Its capital is Rabat, while its largest city is Casablanca.
The region constituting Morocco has been inhabited since the Paleolithic era over 300,000 years ago. The Idrisid dynasty was established by Idris I in 788 and Morocco was subsequently ruled by a series of other independent dynasties, reaching its zenith as a regional power in the 11th and 12th centuries, under the Almoravid and Almohad dynasties, when it controlled most of the Iberian peninsula and the Maghreb. Centuries of Arab migration to the Maghreb since the 7th century shifted the demographic scope of the region. In the 15th and 16th centuries, Morocco faced external threats to its sovereignty, with Portugal seizing some territory and the Ottoman Empire encroaching from the east. The Marinid and Saadi dynasties otherwise resisted foreign domination, and Morocco was the only North African nation to escape Ottoman dominion. The 'Alawi dynasty, which rules the country to this day, seized power in 1631, and over the next two centuries expanded diplomatic and commercial relations with the Western world. Morocco's strategic location near the mouth of the Mediterranean drew renewed European interest; in 1912, France and Spain divided the country into respective protectorates, reserving an international zone in Tangier. Following intermittent riots and revolts against colonial rule, in 1956, Morocco regained its independence and reunified.
Since independence, Morocco has remained relatively stable. It has the fifth-largest economy in Africa and wields significant influence in both Africa and the Arab world; it is considered a middle power in global affairs and holds membership in the Arab League, the Arab Maghreb Union, the Union for the Mediterranean, and the African Union. Morocco is a unitary semi-constitutional monarchy with an elected parliament. The executive branch is led by the King of Morocco and the prime minister, while legislative power is vested in the two chambers of parliament: the House of Representatives and the House of Councillors. Judicial power rests with the Constitutional Court, which may review the validity of laws, elections, and referendums. The king holds vast executive and legislative powers, especially over the military, foreign policy and religious affairs; he can issue decrees called "dahirs", which have the force of law, and can also dissolve the parliament after consulting the prime minister and the president of the constitutional court.
Morocco claims ownership of the non-self-governing territory of Western Sahara, which it has designated its Southern Provinces. In 1975, after Spain agreed to decolonise the territory and cede its control to Morocco and Mauritania, a guerrilla war broke out between those powers and some of the local inhabitants. In 1979, Mauritania relinquished its claim to the area, but the war continued to rage. In 1991, a ceasefire agreement was reached, but the issue of sovereignty remained unresolved. Today, Morocco occupies two-thirds of the territory, and efforts to resolve the dispute have thus far failed to break the political deadlock.
Etymology and name.
The English "Morocco" is an anglicisation of the Spanish name for the country, , derived from the name of the city of Marrakesh, which was the capital of the Almoravid dynasty, the Almohad Caliphate, and the Saadian dynasty. During the Almoravid dynasty, the city of Marrakesh was established under the name of , derived from the city's ancient Berber name of (lit. 'land/country of God'). In English, the first vowel has been changed, likely influenced by the word "Moor".
Historically, the territory has been part of what Muslim geographers referred to as "al-Maghrib al-Aqṣā " (, 'the Farthest West [of the Islamic world]' designating roughly the area from Tiaret to the Atlantic) in contrast with neighbouring regions of "al-Maghrib al-Awsaṭ " (, 'the Middle West': Tripoli to Béjaïa) and "al-Maghrib al-Adnā " (, 'the Nearest West': Alexandria to Tripoli).
Morocco's modern Arabic name is (, transl. the land of the sunset; the west), with the Kingdom's official Arabic name being (; transl. the kingdom of sunset/the west). In Turkish, Morocco is known as , a name derived from its medieval capital of Fes which is derived from the Arabic word "Faʾs" (; transl. pickaxe), as the city's founder Idris I ibn Abd Allah reputedly used a silver and gold pickaxe to trace the outlines of the city. In other parts of the Islamic world, for example in Egyptian and Middle Eastern Arabic literature before the mid-20th century, Morocco was commonly referred to as (). The term is still used to refer to Morocco today in several Indo-Iranian languages, including Persian, Urdu, and Punjabi.
Morocco has also been referred to politically by a variety of terms denoting the Sharifi heritage of the 'Alawi dynasty, such as (), () and (), rendered in French as and in English as the 'Sharifian Empire'.
History.
Prehistory and antiquity.
The area of present-day Morocco has been inhabited since at least Paleolithic times, beginning sometime between 190,000 and 90,000 BC. A recent publication has suggested that there is evidence for even earlier human habitation of the area: "Homo sapiens" fossils that had been discovered in the late 2000s near the Atlantic coast in Jebel Irhoud were recently dated to roughly 315,000 years ago. During the Upper Paleolithic, the Maghreb was more fertile than it is today, resembling a savanna, in contrast to its modern arid landscape. 
DNA studies of Iberomaurusian peoples at Taforalt, Morocco dating to around 15,000 years ago have found them to have a distinctive Maghrebi ancestry formed from a mixture of Near Eastern and African ancestry, which is still found as a part of the genome of modern Northwest Africans. Later during the Neolithic, from around 7,500 years ago onwards, there was a migration into Northwest Africa of European Neolithic Farmers from the Iberian Peninsula (who had originated in Anatolia several thousand years prior), as well as pastoralists from the Levant, both of whom also significantly contributed to the ancestry of modern Northwest Africans. The proto-Berber tribes evolved from these prehistoric communities during the late Bronze- and early Iron ages.
In the early part of Classical Antiquity, Northwest Africa and Morocco were slowly drawn into the wider emerging Mediterranean world by the Phoenicians, who established trading colonies and settlements there, the most substantial of which were Chellah, Lixus, and Mogador. Mogador was established as a Phoenician colony as early as the 6th century BC.
Morocco later became a realm of the Northwest African civilisation of ancient Carthage, and part of the Carthaginian empire. The earliest known independent Moroccan state was the Berber kingdom of Mauretania, under King Baga. This ancient kingdom (not to be confused with the modern state of Mauritania) flourished around 225 BC or earlier. Mauretania became a client kingdom of the Roman Empire in 33 BC. Emperor Claudius annexed Mauretania directly in 44 AD, making it a Roman province ruled by an imperial governor (either a "procurator Augusti", or a "legatus Augusti pro praetore").
Christianity in Morocco appeared during the Roman times, when it was practiced by Berber Christians in Roman Mauretania Tingitana. During the Crisis of the Third Century, parts of Mauretania were reconquered by Berbers. By the late 3rd century, direct Roman rule had become confined to a few coastal cities, such as Septum (Ceuta) in Mauretania Tingitana and Cherchell in Mauretania Caesariensis. When, in 429 AD, the area was devastated by the Vandals, the Roman Empire lost its remaining possessions in Mauretania, and local Mauro-Roman kings assumed control of them. In the 530s, the Eastern Roman Empire, under Byzantine control, re-established direct imperial rule of Septum and Tingi, fortified Tingis and erected a church.
Foundation and dynasties.
The Muslim conquest of the Maghreb that had begun during the mid-7th century was completed under the Umayyad Caliphate by 709. The caliphate introduced both Islam and the Arabic language to the area; this period also saw the beginning of a trend of Arab migration to the Maghreb which would last for centuries and effect a demographic shift in the region. While constituting part of the larger empire, Morocco was initially organised as a subsidiary province of Ifriqiya, with the local governors appointed by the Muslim governor in Kairouan.
The indigenous Berber tribes adopted Islam, but retained their customary laws. They also paid taxes and tribute to the new Muslim administration. The first independent Muslim state in the area of modern Morocco was the Kingdom of Nekor, an emirate in the Rif Mountains. It was founded by Salih I ibn Mansur in 710, as a client state to the Umayyad Caliphate. After the outbreak of the Berber Revolt in 739, the Berbers formed other independent states such as the Miknasa of Sijilmasa and the Barghawata.
The founder of the Idrisid dynasty and the great-grandson of Hasan ibn Ali, Idris ibn Abdallah, had fled to Morocco after the massacre of his family by the Abbasids in the Hejaz. He convinced the Awraba Berber tribes to break their allegiance to the distant Abbasid caliphs and he founded the Idrisid dynasty in 788. The Idrisids established Fes as their capital and Morocco became a centre of Muslim learning and a major regional power. The Idrisids were ousted in 927 by the Fatimid Caliphate and their Miknasa allies. After Miknasa broke off relations with the Fatimids in 932, they were removed from power by the Maghrawa of Sijilmasa in 980.
From the 11th century onward, a series of Berber dynasties arose. Under the Sanhaja Almoravid dynasty and the Masmuda Almohad dynasty, Morocco dominated the Maghreb, al-Andalus in Iberia, and the western Mediterranean region. From the 13th century onward the country saw a massive migration of the Banu Hilal Arab tribes. In the 13th and 14th centuries the Zenata Berber Marinids held power in Morocco and strove to replicate the successes of the Almohads through military campaigns in Algeria and Spain. They were followed by the Wattasids. In the 15th century, the Reconquista ended Muslim rule in Iberia and many Muslims and Jews fled to Morocco. Portuguese efforts to control the Atlantic sea trade in the 15th century did not greatly affect the interior of Morocco even though they managed to control some possessions on the Moroccan coast but not venturing further afield inland.
In 1549, the region fell to successive Arab dynasties claiming descent from the Islamic prophet Muhammad: first the Saadi dynasty who ruled from 1549 to 1659, and then the Alawi dynasty, who have remained in power since the 17th century. Morocco faced aggression from Spain in the north, and the Ottoman Empire's allies pressing westward.
Under the Saadis, the sultanate ended the Portuguese Aviz dynasty in 1578 at the Battle of Alcácer Quibir. The reign of Ahmad al-Mansur brought new wealth and prestige to the Sultanate, and a large expedition to West Africa inflicted a crushing defeat on the Songhay Empire in 1591. However, managing the territories across the Sahara proved too difficult. Upon the death of al-Mansur, the country was divided among his sons.
After a period of political fragmentation and conflict during the decline of the Saadi dynasty, Morocco was finally reunited by the Alawi sultan al-Rashid in the late 1660s, who took Fez in 1666 and Marrakesh in 1668. The 'Alawis succeeded in stabilising their position, and while the kingdom was smaller than previous ones in the region, it remained quite wealthy. Against the opposition of local tribes Ismail Ibn Sharif (1672–1727) began to create a unified state. With his Riffian army, he re-occupied Tangier from the English who had abandoned it in 1684 and drove the Spanish from Larache in 1689. The Portuguese abandoned Mazagão, their last territory in Morocco, in 1769. However, the siege of Melilla against the Spanish ended in defeat in 1775.
Morocco was the first nation to recognise the fledgling United States as an independent nation in 1777. In the beginning of the American Revolution, American