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 km², 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.