Berbers, Rome, and the first dynasty
The Amazigh — the people outsiders call Berbers — were here before anyone thought to write the region's history, and they are still the demographic foundation of the country. Phoenicians traded along the coast; Rome ran a province from Volubilis, whose mosaics still sit intact in the hills near Meknes.
Islam arrived in the late seventh century, but Morocco was never governed from the Arab east for long. In 788 Idris I, a refugee descendant of the Prophet, founded the first Moroccan Muslim dynasty and the city of Fez. The claim of descent from the Prophet — sharifian descent — has underwritten the legitimacy of Moroccan rulers ever since, and still does.
The empires that ruled Spain
In the eleventh and twelfth centuries Morocco was the centre, not the periphery. The Almoravids, a Saharan Berber movement, built an empire that ran from Senegal to the middle of Spain and made Marrakesh their capital. The Almohads who replaced them ruled an even larger one and left the Koutoubia minaret in Marrakesh and the Giralda in Seville — the same architects, two continents.
When Muslim Spain finally fell in 1492, Morocco absorbed much of what fled: Andalusi Muslims and Sephardic Jews who reshaped Fez, Tetouan and Rabat. In 1578 three kings died at the Battle of the Three Kings near Ksar el-Kebir, a Portuguese disaster that ended Portugal's independence for sixty years. The victor's successor, Ahmad al-Mansur, sent an army across the Sahara in 1591 and destroyed the Songhai Empire at Tondibi to seize the gold and salt trade — one of the few times a North African state projected power deep into the Sahel.
The Alaouites and the protectorate
The Alaouite dynasty took power in the 1660s and has held it since, which makes it one of the oldest ruling houses in the world. It kept Morocco independent through the era when the Ottomans took the rest of North Africa and Europe took nearly everywhere else.
That ended in 1912, when France and Spain carved the country into protectorates and Tangier was made an international zone. Resistance was fierce: in the Rif mountains Abd el-Krim declared a republic and destroyed a Spanish army at Annual in 1921 before being crushed by a joint Franco-Spanish force using aircraft and gas. Sultan Mohammed V became the focus of the independence movement; the French exiled him in 1953 and had to bring him back two years later. Independence came in 1956.
A modern kingdom, and the Sahara
Mohammed V's son Hassan II ruled for thirty-eight years, survived two coup attempts, and ran a period now openly remembered as the "years of lead" for its political imprisonment. In 1975 he organised the Green March: some 350,000 Moroccans walked into Spanish-held Western Sahara, and Morocco has controlled most of it ever since, against the Polisario Front and a UN-recognised claim to self-determination that remains unresolved.
Mohammed VI, king since 1999, has liberalised the family law, recognised Tamazight as an official language, and after the 2011 protests conceded a new constitution — while keeping the essentials of power in the palace. In September 2023 an earthquake in the High Atlas killed roughly three thousand people, most of them in remote Amazigh villages the state had long neglected.