Spain or the Kingdom of Spain (Reino de España), is a country in southwestern Europe with parts of territory in the Atlantic Ocean and across the Mediterranean Sea. The largest part of Spain is situated on the Iberian Peninsula; its territory also includes the Canary Islands in the Atlantic Ocean, the Balearic Islands in the Mediterranean Sea, the autonomous cities of Ceuta and Melilla, and several minor overseas territories also scattered along the Moroccan coast of the Alboran Sea. The country's mainland is bordered to the south by Gibraltar; to the south and east by the Mediterranean Sea; to the north by France, Andorra and the Bay of Biscay; and to the west by Portugal and the Atlantic Ocean.
With an area of 505,990 km2 (195,360 sq mi), Spain is the largest country in Southern Europe, the second-largest country in Western Europe and the European Union, and the fourth-largest country by area on the European continent. With a population exceeding 47.4 million, Spain is the sixth-most populous country in Europe, and the fourth-most populous country in the European Union. Spain's capital and largest city is Madrid; other major urban areas include Barcelona, Valencia, Seville, Zaragoza, Málaga, Murcia, Palma de Mallorca, Las Palmas de Gran Canaria and Bilbao.
Anatomically modern humans first arrived in the Iberian Peninsula around 42,000 years ago. The first cultures and peoples that developed in current Spanish territory were Pre-Roman peoples such as the ancient Iberians, Celts, Celtiberians, Vascones, and Turdetani. Later, foreign Mediterranean peoples such as the Phoenicians and ancient Greeks developed coastal trading colonies, and the Carthaginians briefly controlled part of the Spanish Mediterranean coastline. From the year 218 BCE, the Roman colonization of Hispania began and, with the exception of the Atlantic cornice, they quickly controlled the territory of present-day Spain. The Romans had driven the Carthaginians out of the Iberian peninsula by 206 BCE, and divided it into two administrative provinces, Hispania Ulterior and Hispania Citerior. The Romans left a long-lasting legacy that included their language, religion, laws and political and social institutions. Hispania was also the birthplace of Roman emperors such as Trajan or Hadrian.Hispania remained under Roman rule until the collapse of the Western Roman Empire in the fifth century, which ushered in Germanic tribal confederations from Northern and Central Europe. During this period, the peninsula was ruled by the likes of the Suevi, Alans, Vandals and Visigoths, while part of the Mediterranean Coast belonged to the Byzantine Empire. Eventually, the Visigothic Kingdom emerged as the dominant power in the peninsula by the fifth century.
In the early eighth century, the Visigothic Kingdom was invaded by the Umayyad Caliphate, ushering in over 700 years of Muslim rule in Southern Iberia. During this period, Al-Andalus became a major economic and intellectual centre, with the city of Córdoba being among the largest and richest in Europe. Several Christian kingdoms emerged in Northern Iberia, chief among them León, Castile, Aragón, Portugal, and Navarre. Over the next seven centuries, an intermittent southward expansion of these kingdoms—metahistorically framed as a reconquest, or Reconquista—culminated with the Christian seizure of the last Muslim polity in the peninsula, the Nasrid Kingdom of Granada in 1492. That same year, Christopher Columbus arrived in the New World on behalf of the Catholic Monarchs, whose dynastic union of the Crown of Castile and the Crown of Aragon is usually considered the emergent Spain as a unified country. Jews and Muslims were forced to convert to Catholicism and the latter were eventually expelled from Castile and Aragon. The upholding of religious orthodoxy among converts was tasked to the Inquisition. In the wake of the Spanish colonization of the Americas, the Crown came to hold a large overseas empire, which underpinned the emergence of a global trading system primarily fuelled by the silver extracted in the New World.Spain is a developed country, a secular parliamentary democracy and a constitutional monarchy, with King Felipe VI as head of state. It is a high-income country and an advanced economy, with the world's fourteenth-largest economy by nominal GDP and the sixteenth-largest by PPP. Spain has one of the longest life expectancies in the world at 83.5 years in 2019. It ranks particularly high in healthcare quality, with its healthcare system considered to be one of the most efficient worldwide. It is a world leader in organ transplants and organ donation. Spain is a member of the United Nations (UN), the European Union (EU), the Eurozone, the Council of Europe (CoE), the Organization of Ibero-American States (OEI), the Union for the Mediterranean, the North Atlantic Treaty Organization (NATO), the Organisation for Economic Co-operation and Development (OECD), Organization for Security and Co-operation in Europe (OSCE), the World Trade Organization (WTO) and many other international organisations.
Spanish art, music, literature and cuisine have been influential worldwide, particularly in Western Europe and the Americas. As a reflection of its large cultural wealth, Spain has the world's fourth-largest number of World Heritage Sites (49) and is the world's second-most visited country. Its cultural influence extends over 570 million Hispanophones, making Spanish the world's second-most spoken native language.