Independence from France: 2 March 1956
The region was conquered by the Almoravids in the second half of the eleventh century and a capital founded at Marrakech. They eventually had an empire which included Algeria, Ghana and much of Spain. In the second part of the twelfth century the region was conquered in turn by the Almohads, also Berber Muslims, who took over the empire, and extended it to the west as far as Tripoli.
From the fifteenth century, Portuguese and Spanish attempted to invade coastal areas, taking several ports, including Ceuta -- they met strong resistance. In the sixteenth century, Ahmad Al-Mansur, the Golden overthrew the Sonhai empire to the south and retook coastal areas from the Spanish. The region became a major destination for trans-Saharan slave trade despite internal conflict over whether free men could be made slaves under Islamic law. (Slavery of Christians was "abolished" by Sidi Muhammed in 1777.)
France incorporated Morocco into its Trans-Saharan empire in the 1890's after a long struggle to remain independent. It finally achieved independence from France in 1956.
Find out more:
History of Morocco