Morocco’s first-known inhabitants were Near Eastern nomads who may have been distant cousins of the ancient Egyptians. Phoenicians appear to have arrived around 800 BC, and when the Romans arrived in the 4th century BC, they called the expanse of Morocco and western Algeria ‘Mauretania’ and the indigenous people ‘Berbers’, meaning ‘barbarians’.
In the 1st century AD, the Romans built up Volubilis into a city of 20,000 (mostly Berber) people, but, fed up with the persistently unruly Berbers, the Roman emperor Caligula declared the end of Berber autonomy in North Africa in AD 40. But whereas the Vandals and Byzantines failed to oust the Romans from their home turf, Berbers in the Rif and the Atlas ultimately succeeded through a campaign of near-constant harassment – a tactic that would later put the squeeze on many an unpopular Moroccan sultan.
As Rome slipped into decline, the Berbers harried and hassled any army that dared to invade to the point where the Berbers were free to do as they pleased.
In the second half of the 7th century, the soldiers of the Prophet Mohammed set forth from the Arabian Peninsula and overwhelmed the peoples of North Africa. Within a century, nearly all Berber tribes had embraced Islam, although, true to form, local tribes developed their own brand of Islamic Shi’ism, which sparked rebellion against the eastern Arabs.
By 829, local elites had established an Idrissid state with its capital at Fès, dominating all of Morocco. Thus commenced a cycle of rising and falling Islamic dynasties, which included the Almoravids (1062–1147), who built their capital at Marrakesh; the Almohads (1147–1269), famous for building the Koutoubia Mosque; the Merenids (1269–1465), known for their exquisite mosques and madrassas (Quranic schools), especially in Fès; the Saadians (1524–1659), responsible for the Palais el-Badi in Marrakesh; and the Alawites (1659–present).
France took control in 1912, making its capital at Rabat and handing Spain a token zone in the north. Opposition from Berber mountain tribes was officially crushed, but continued to simmer away and moved into political channels with the development of the Istiqlal (independence) party.
When Mohammed V died suddenly of heart failure in 1961, King Hassan II became the leader of the new nation. Hassan II consolidated power by crackdowns on dissent and suspending parliament for a decade. With heavy borrowing and an ever-expanding bureaucracy, Morocco was deeply in debt by the 1970s. In 1973, the phosphate industry in the Spanish Sahara started to boom. Morocco staked its claim to the area and its lucrative phosphate reserves with the 350,000-strong Green March into Western Sahara in 1975, settling the area with Moroccans while greatly unsettling indigenous Sahrawi people agitating for self-determination.
Such grand and patriotic flourishes notwithstanding, the growing gap between the rich and the poor ensured that dissent remained widespread across a broad cross-section of Moroccan society. Protests against price rises in 1981 prompted a brutal government crackdown, but sustained pressure from human rights activists achieved unprecedented results in 1991, when Hassan II founded the Truth & Reconciliation Commission to investigate human rights abuses that occurred during his own reign – a first for a king.
Hassan II died in 1999 and Morocco held its breath. In his first public statement as king, Mohammed VI vowed to right the wrongs of the era known to Moroccans as ‘the Black Years’. Today, Morocco’s human rights record is arguably the cleanest in Africa and the Middle East, though still not exactly spotless – repressive measures were revived after 9/11 and the 2003 Casablanca bombings. But the commission has nonetheless helped cement human rights advances by awarding reparations to more than 9000 victims of the Black Years.
Mohammed VI has overseen small but real reformist steps, including elections, the introduction of Berber languages in some state schools, and the much-anticipated Mudawanna, a legal code protecting women’s rights to divorce and custody. The king has also forged closer ties with Europe and overseen a tourism boom.
In 2011 he revised the constitution in response to the Arab Spring and appointed a new government in January 2012. But by May powerful trade unions had launched mass protests against the authorities' failure to meet democratic and economic expectations.