Morocco  Morocco (; ; ; ), officially the Kingdom of Morocco (; ; ), is a country located in the Maghreb region of North Africa. It overlooks the Mediterranean Sea to the north and the Atlantic Ocean to the west, with land borders with Algeria to the east and Western Sahara ("status disputed") to the south. Morocco also claims the exclaves of Ceuta, Melilla and Peñón de Vélez de la Gomera, all of them under Spanish jurisdiction, as well as several small Spanish-controlled islands off its coast. The capital is Rabat and the largest city is Casablanca. Morocco spans an area of and has a population of over 36 million. 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 Almoravid and Almohad rule, when it spanned parts of Iberia and northwestern Africa. The Portuguese Empire began in Morocco in the 15th century, following Portuguese conquests along the Moroccan coast, founding settlements which lasted into the 17th and 18th centuries. The Marinid and Saadi dynasties resisted foreign domination into the 17th century, 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. The country's strategic location near the mouth of the Mediterranean attracted the interest of Europe, and 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, with the fifth largest economy in Africa. Morocco claims the non-self-governing territory of Western Sahara, formerly Spanish Sahara, as its Southern Provinces. After Spain agreed to decolonise the territory to Morocco and Mauritania in 1975, a guerrilla war arose with local forces. Mauritania relinquished its claim in 1979, and the war lasted until a ceasefire in 1991. Morocco currently occupies two thirds of the territory, and peace processes have thus far failed to break the political deadlock. The sovereign state is a unitary Semi-constitutional monarchy with an elected parliament. The country wields significant influence in both Africa and the Arab world, and is considered a regional power and a middle power. The King of Morocco holds vast executive and legislative powers, especially over the military, foreign policy and religious affairs.