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, Morocco, Algeria, Tunisia, and Libya were slowly drawn into the emerging
Mediterranean world by the
Phoenicians, who established trading colonies and settlements, 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 coin in
Fes, 840 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 peoples 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. , founded in
Fes in the 9th century, was a major spiritual, literary, and intellectual centre. 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. at its greatest extent, 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, with
Muslims and
Jews fleeing to find refuge in Morocco.
Portuguese efforts to control the Atlantic sea trade in the 15th century did not greatly affect the interior of Morocco, despite that the Portuguese managed to control some possessions on the Moroccan coast, while not venturing further afield inland. was founded when
Prince Henry the Navigator led the
conquest of Ceuta, which began the Portuguese presence in Morocco, lasting from 1415 to 1769. 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. of Portugal being presented before Sultan Ahmad al-Mansur after the
Battle of Alcácer Quibir 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.'s 16th-century
Badi' Palace 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 merchant ships in the Atlantic Ocean were subject to attacks by other fleets. On 20 December 1777, Morocco's Sultan
Mohammed III declared that American merchant ships would be under the protection of the sultanate and could thus enjoy safe passage. The 1786
Moroccan–American Treaty of Friendship stands as the United States' oldest unbroken friendship treaty.
French and Spanish protectorates after the
Hispano-Moroccan War (1859–1860) bankrupted Morocco's national treasury, forcing the
Makhzen to take on a British loan. As Europe industrialised, Northwest Africa was increasingly prized for its potential for colonisation. France showed a strong interest in Morocco as early as 1830, not only to protect the border of its Algerian territory, but also because of the strategic position of Morocco with coasts on the Mediterranean and the open Atlantic. In 1860, a dispute over Spain's
Ceuta enclave led Spain to declare war. Victorious Spain won a further enclave and an enlarged Ceuta in the settlement. In 1884, Spain created a protectorate in the coastal areas of Morocco. 's population in 1956 included 40,000 Muslims, 31,000 Europeans and 15,000 Jews. In 1904, France and Spain carved out zones of influence in Morocco. Recognition by the
United Kingdom of France's
sphere of influence provoked a strong reaction from the
German Empire; and a crisis loomed in 1905. The matter was resolved at the
Algeciras Conference in 1906. The
Agadir Crisis of 1911 increased tensions between European powers. The 1912
Treaty of Fez made Morocco a
protectorate of France, and triggered the
1912 Fez riots. Spain continued to operate its coastal protectorate. By the same treaty, Spain assumed the role of
protecting power over the northern coastal and southern
Saharan zones. from 1907 to 1934 Tens of thousands of colonists entered Morocco. Some bought up large amounts of rich agricultural land, while others organised the exploitation and modernisation of mines and harbours. Interest groups that formed among these elements continually pressured France to increase its control over Morocco – with some Moroccan tribes allying with the French against other competing tribes from early on in its conquest. The French colonial administrator, general Marshal
Hubert Lyautey, sincerely admired Moroccan culture and succeeded in imposing a joint Moroccan-French administration, while creating a modern school system. Several divisions of Moroccan soldiers (
Goumiers or regular troops and officers) served in the
French army in both
World War I and
World War II, and in the Spanish
Nationalist Army in the
Spanish Civil War and after (
Regulares). The institution of
slavery was abolished in 1925. Between 1921 and 1926, an
uprising in the
Rif Mountains, led by
Abd el-Krim, led to the establishment of the
Republic of the Rif. The Spanish used anti-civilian bombing raids and mustard gas to prevent the Rif republic from gaining independence. They lost more than 13,000 soldiers at
Annual in July–August 1921 alone. The Riffi were eventually suppressed by 1927 by the Franco-Spanish military. The casualties on the Spanish-French side were 52,000, while approximately 10,000
Riffians died. of 1944 In 1943, the
Istiqlal Party (Independence Party) was founded to press for independence, with discreet US support. Moroccan nationalists drew heavily on
transnational activist networks for lobbying to end colonial rule, primarily at the United Nations. The Istiqlal Party subsequently provided most of the leadership for the nationalist movement. during a visit to the United States in 1957 France's exile of Sultan
Mohammed V in 1953 to
Madagascar and his replacement by the unpopular
Mohammed Ben Aarafa sparked active opposition to the French and Spanish protectorates. The most notable violence occurred in
Oujda where Moroccans attacked French and other European residents in the streets. France allowed Mohammed V to return in 1955, and the negotiations that led to Moroccan independence began the following year. In March 1956 Morocco regained its independence from France as the Kingdom of Morocco. A month later, Spain forsook its protectorate in northern Morocco to the new state but kept its two coastal-Mediterranean enclaves (
Ceuta and
Melilla, which dated from earlier conquests), over which Morocco still claims
sovereignty to this day.
Post-independence Sultan Mohammed became King in 1957. Upon the death of Mohammed V,
Hassan II became King of Morocco on 3 March 1961. Morocco held its first
general elections in 1963. However, Hassan declared a state of emergency and suspended parliament in 1965. In 1971 and 1972, there were two failed attempts to depose the king and establish a republic. A truth commission set up in 2005 to investigate human rights abuses during his reign confirmed nearly 10,000 cases, ranging from death in detention to forced exile. Some 592 people were recorded killed during Hassan's rule according to the truth commission. In 1963, the
Sand War was fought between Algerian and Moroccan troops over Moroccan claims to parts of Algerian territory. A formal peace agreement was signed in February 1964; however, relations remained strained between the two countries following the conflict. The Spanish
enclave of
Ifni in the south was returned to Morocco in 1969. The
Polisario movement was formed in 1973, with the aim of establishing an independent state in the Spanish Sahara. On 6 November 1975, King Hassan asked for volunteers to cross into the Spanish Sahara. Some 350,000 civilians were reported as being involved in the "
Green March". A month later, Spain agreed to leave the Spanish Sahara, soon to become Western Sahara, and to transfer it to joint Moroccan-Mauritanian control, despite the objections and threats of military intervention by Algeria. Moroccan forces occupied the territory. Algerian authorities have estimated the number of
Sahrawi refugees in Algeria to be 165,000. Diplomatic relations with Algeria were restored in 1988. In 1991, a UN-monitored ceasefire began in Western Sahara, but the territory's status remains undecided and ceasefire violations are reported. The following decade saw much wrangling over a
proposed referendum on the future of the territory but the deadlock was not broken. (1975–1991) Political reforms in the 1990s resulted in the establishment of a bicameral legislature with Morocco's first opposition-led government coming to power. King
Hassan II died in 1999 and was succeeded by his son,
Mohammed VI. He is a cautious moderniser who has introduced economic and social liberalisation. Mohammed VI paid a controversial visit to the Western Sahara in 2002. Morocco unveiled an autonomy blueprint for Western Sahara to the United Nations in 2007. The Polisario rejected the plan and put forward its own proposal. Morocco and the Polisario Front held UN-sponsored talks in New York City but failed to come to any agreement. In 2010, security forces stormed a protest camp in the Western Sahara, triggering violent demonstrations in the regional capital
El Aaiún. and other world leaders and representatives attend the
Armistice Day centenary in November 2018. In 2002, Morocco and Spain agreed to a US-brokered resolution over the disputed island of
Perejil. Spanish troops had taken the normally uninhabited island after Moroccan soldiers landed on it and set up tents and a flag. There were renewed tensions in 2005, as dozens of African migrants stormed the borders of the Spanish enclaves of Melilla and Ceuta. In response, Spain deported dozens of the illegal migrants to Morocco from Melilla. In 2006, the Spanish Premier
Zapatero visited Spanish enclaves. He was the first Spanish leader in 25 years to make an official visit to the territories. The following year, Spanish King
Juan Carlos I visited Ceuta and Melilla, further angering Morocco which demanded control of the enclaves. During the
2011–2012 Moroccan protests, thousands of people rallied in Rabat and other cities calling for political reform and a new constitution curbing the powers of the king. In July 2011, the King won a landslide victory in a
referendum on a reformed constitution he had proposed to placate the
Arab Spring protests. In the first
general elections that followed, the moderate Islamist
Justice and Development Party won a plurality of seats, with
Abdelilah Benkirane being designated as head of government per the new constitution. Despite the reforms made by Mohammed VI, demonstrators continued to call for deeper reforms. Hundreds took part in a trade union rally in Casablanca in May 2012. Participants accused the government of failing to deliver on reforms. On 24 August 2021, neighbouring Algeria cut diplomatic relations with Morocco, accusing Morocco of supporting a separatist group and hostile actions against Algeria. Morocco called the decision unjustified. Foreign Minister
Ramtane Lamamra accused Morocco of using
Pegasus spyware against its officials.
Amnesty International found that two phones of Sahraoui human rights defender
Aminatou Haidar were infected in November 2021. On 10 December 2020, the
Israel–Morocco normalisation agreement was announced, and Morocco announced its intention to resume diplomatic relations with Israel. Joint Declaration of the Kingdom of Morocco, the United States of America and the State of Israel was signed on 22 December 2020. The agreement was met with criticism due to the October 2023
Gaza war. Moroccan Foreign Minister
Nasser Bourita argues that maintaining relations does not signify endorsement of the State of Israel’s actions. On 8 September 2023, a 6.8 magnitude
earthquake hit Morocco killing more than 2,800 people and injuring thousands. The
epicentre of the quake was around 70 km southwest of city of Marrakesh. The
2025 Moroccan protests emerged against a backdrop of high youth unemployment, which official statistics placed at 35.8%, in addition to allegations of corruption and popular discontent over
social inequality in Morocco. == Geography ==