Spain, formally the Kingdom of Spain, is a country in Southwestern Europe with some pockets of territory in the Mediterranean Sea, offshore in the Atlantic Ocean and across the Strait of Gibraltar. Its continental European territory is situated on the Iberian Peninsula, and its insular territory includes the Balearic Islands in the Mediterranean Sea, several small islands in the Alboran Sea and the Canary Islands in the Atlantic Ocean. The Spanish territory also includes the African semi-exclaves of Ceuta, Melilla and Peñon de Vélez across the Strait of Gibraltar. The country's mainland is bordered 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 km², 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.