Morocco (المغرب; ; Maroc), officially the Kingdom of Morocco (المملكة المغربية; ; Royaume du Maroc), is a country located in the Maghreb region of North West Africa with an area of 710,850 km2. Its capital is Rabat, the largest city Casablanca. It overlooks the Mediterranean Sea to the north and the Atlantic Ocean to the west. Morocco claims the areas of Ceuta, Melilla and Peñón de Vélez de la Gomera, all of them under Spanish jurisdiction.
Since the foundation of the first Moroccan state by Idris I in 788 AD, the country has been ruled by a series of independent dynasties, reaching its zenith under the Almoravid and Almohad dynasties, spanning parts of Iberia and northwestern Africa. The Marinid and Saadi dynasties continued the struggle against foreign domination, allowing Morocco to remain the only northwest African country to avoid Ottoman occupation. The Alaouite dynasty, which rules to this day, seized power in 1631. In 1912, Morocco was divided into French and Spanish protectorates, with an international zone in Tangier. It regained its independence in 1956, and has since remained comparatively stable and prosperous by regional standards.