Spain is located on the Iberian Peninsula. The coastline of Spain is washed by the Bay of Biscay (Cantabrian Sea) to the north, the Mediterranean Sea to the southeast, and the Atlantic Ocean to the west. The country borders Andorra (a microstate in the Pyrenees), France, the tiny British overseas territory of Gibraltar (United Kingdom), Portugal, and Morocco (in the Spanish enclaves of Ceuta and Melilla on the North African coast). Spain shares maritime borders with Algeria and Italy. The country covers an area of 505,992 km², making it the fourth largest in Europe and the second largest in Western Europe. For comparison, it is about twice the size of the United Kingdom.
The Kingdom of Spain has a population of 47.1 million (as of 2020), with Madrid as its capital and largest city. The second largest city in Spain is Barcelona, the capital of Catalonia. The official and national language is Spanish, with co-official languages being Catalan, Galician, and Basque.
Spain is known for its food, flamenco music and dance, siesta, bullfighting, horses, art and literature, architecture, Moorish heritage, islands, Mediterranean beaches, wines, fruits, and football.
In ancient times, the Iberian Peninsula, on the southwestern edge of Europe, was inhabited by various ethnic groups. In the second millennium BC, Iberian tribes migrated to the peninsula, either from North Africa or Southern Europe, and spread over a large area. In the 8th and 9th centuries BC, the peninsula was invaded by Phoenicians, Greeks, Carthaginians and a significant number of Celtic immigrants from central and northern Europe. These are very diverse ethnic stocks from the pre-Roman period, constituting the ancestors of the later Spaniards. The diverse societies and tribal organization of the inhabitants of Iberia slow down the Roman conquest of "Spain", which lasted from 218 BC to 19 BC. With the decline of the Roman Empire, the Suebi, Vandals and Alans took over parts of Spain. They were followed by the Visigoths, who conquered all of Spain in the 5th century AD and founded a kingdom that lasted until 711, when it fell due to the invasion of Islamic North African Moors.
The Reconquista, a battle between the Christian kingdoms and the Moors, lasted until 1492, and in 1512 the unification of modern Spain was completed. During the 16th century, Spain became the most powerful state in Europe, thanks to the vast wealth it gained from its possessions in the Americas. The steady decline of Spain's power in Europe began in the late 16th century, and in the 19th century Spain lost most of its colonies. After the victory of his Nationalist forces in 1939, General Francisco Franco ruled a country that was politically and economically exhausted and isolated by the Allies.
In 1955, Spain joined the United Nations. In 1969, General Franco appointed Prince Juan Carlos as the next ruler of Spain, and in 1975, Juan Carlos assumed the position of king and head of state. Spain joined NATO in 1982 and became a member of the European Union in 1986.