Morocco, officially the Kingdom of Morocco, is the northwesternmost country in the Maghreb region of North Africa. It overlooks the Mediterranean Sea to the north and the Atlantic Ocean to the west, and has land borders with Algeria to the east, and the disputed territory of Western Sahara to the south. Morocco also claims the Spanish exclaves of Ceuta, Melilla and Peñón de Vélez de la Gomera, and several small Spanish-controlled islands off its coast. Morocco spans an area of 710,850 km2 (274,460 sq mi), with a population of 37 million. Its predominant religion is Islam, and its official languages are Arabic and Berber. The Moroccan dialect of Arabic, and French are also widely spoken. Moroccan culture is a vibrant mix of Berber, Arab, and European cultures, and its capital is Rabat, while largest city is Casablanca.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 in the 11th and 12th centuries under the Almoravid and Almohad dynasties, when it controlled most of the Iberian Peninsula and the Maghreb. Beginning in the 15th century, the Portuguese extended their area of control to include parts of Morocco. The Moroccan dynasties of Marinid and Saadi otherwise resisted foreign domination, and Morocco was the only North African nation to escape occupation by the Ottoman Empire. The Alaouite dynasty, which rules Morocco to this day, seized power in 1631.
Morocco's strategic location near the mouth of the Mediterranean attracted renewed interest of European powers in the early 20th century. In 1912, France and Spain divided Morocco into French and Spanish protectorates, respectively, reserving an international zone in Tangier. In 1956 Morocco regained its independence and reunified. Since then, it has been a relatively stable and prosperous nation, and it has the fifth-largest economy in Africa.
Morocco claims ownership of the non-self-governing territory of Western Sahara, which it has designated its Southern Provinces. In 1975, after Spain agreed to decolonise the territory and cede its control to Morocco and Mauritania, a guerrilla war broke out between those powers and some of the local inhabitants. In 1979, Mauritania relinquished its claim to the area, but the war continued to rage. In 1991, a ceasefire agreement was reached, but the issue of sovereignty remained unresolved. Today, Morocco occupies two thirds of the territory, and efforts to resolve the dispute have thus far failed to break the political deadlock.
Morocco 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 middle power in global affairs. It is a member of the Arab League, the Union for the Mediterranean, and the African Union. The King of Morocco holds vast executive and legislative powers, especially over the military, foreign policy and religious affairs. Executive power is exercised by the government, while legislative power is vested in both the government and the two chambers of parliament, the Assembly of Representatives and the Assembly of Councillors. The king can issue decrees called dahirs, which have the force of law. He can also dissolve the parliament after consulting the Prime Minister and the president of the constitutional court.