Morocco, about one-tenth larger than California, lies across the Strait of Gibraltar on the Mediterranean and looks out on the Atlantic from the northwest shoulder of Africa. Algeria is to the east and Mauritania to the south. On the Atlantic coast there is a fertile plain. The Mediterranean coast is mountainous. The Atlas Mountains, running northeastward from the south to the Algerian frontier, average 11,000 ft (3,353 m) in elevation.
Morocco has been the home of the Berbers since the second millennium B.C. In A.D. 46, Morocco was annexed by Rome as part of the province of Mauritania until the Vandals overran this portion of the declining empire in the 5th century. The Arabs invaded circa 685, bringing Islam. The Berbers joined them in invading Spain in 711, but then they revolted against the Arabs, resenting their secondary status. In 1086, Berbers took control of large areas of Moorish Spain until they were expelled in the 13th century.
The land was rarely unified and was usually ruled by small tribal states. Conflicts between Berbers and Arabs were chronic. Portugal and Spain began invading Morocco, which helped to unify the land in defense. In 1660, Morocco came under the control of the Alawite dynasty. It is a sherif dynasty—descended from the prophet Muhammad—and rules Morocco to this day.
During the 17th and 18th centuries, Morocco was one of the Barbary States, the headquarters of pirates who pillaged Mediterranean traders. European powers showed interest in colonizing the country beginning in 1840, and there were frequent clashes with the French and Spanish. Finally, in 1904, France and Spain concluded a secret agreement that divided Morocco into zones of French and Spanish influence, with France controlling almost all of Morocco and Spain controlling the small southwest portion, which became known as Spanish Sahara. Morocco grew into an even greater object of European rivalry by the turn of the century, almost leading to a European war in 1905 when Germany attempted to gain