Spain country profile
Located at the crossroads of the Atlantic and the Mediterranean, Europe and Africa, Spain's history and culture are made up of a rich mix of diverse elements.
Through exploration and conquest, Spain became a world power in the 16th century, and it maintained a vast overseas empire until the early 19th century.
Spain's modern history is marked by the bitterly fought Spanish Civil War of 1936-39, and the ensuing 36-year dictatorship of General Francisco Franco.
After Franco's death in 1975, Spain made the transition to a democratic state and built a successful economy, with King Juan Carlos as head of state.
The constitution of 1978 enshrines respect for linguistic and cultural diversity within a united Spain. The country is divided into 17 regions which all have their own directly elected authorities.
Kingdom of Spain
Population 46.7 million
Area 505,988 sq km (195,363 sq miles)
Languages Spanish (Castilian), Catalan and its variant Valencian, Gallego (Galician), Euskera (Basque)
Major religion Christianity
Life expectancy 79 years (men), 85 years (women)
Head of state: King Felipe VI
King Felipe succeeded to the throne on the abdication of his father Juan Carlos in June 2014.
Born in 1968 when his father was heir-apparent to the vacant throne during the Franco dictatorship, Prince Felipe was educated for his future royal role, and undertook official engagements on behalf of the king from 1995.
Despite retaining considerable constitutional power as chief executive and commander-in-chief, King Felipe has pledged to continue his father's legacy of supporting the primacy of parliament.
Prime Minister: Pedro Sanchez
Socialist leader Pedro Sanchez took over as prime minister in June 2018, after his conservative predecessor Mariano Rajoy lost a parliamentary vote of confidence.
This was triggered by a long-running corruption trial involving members of Mr Rajoy's Popular Party.
Mr Sanchez lacks a working majority in parliament, and has called a snap election for April 2019.MEDIA
Public broadcaster RTVE shares the market with major commercial operators. Regional TV networks are operated by their respective governments.
Freedom House NGO raises concerns about the concentration of media ownership and what it says is political interference in public media.
There are more than 40 million internet users. Facebook is the leading social platform.
- Read full media profile
Some key dates in Spain's history:
16th-17th centuries - Spanish Empire at its height, with Spain the predominant European power. The rise of Protestant states in northern Europe and the Ottoman Empire in the Mediterranean begin the country's gradual decline.
18th century - The War of the Spanish Succession loses Spain its European possessions outside the Iberian Peninsula.
Bourbon dynasty, originally from France, centralises the Spanish state, shutting down many regional autonomous assemblies and modernising government and the military.
19th century - Napoleonic legacy of political division and economic dislocation leaves Spain weak and unstable, with frequent changes of government and a low-level insurgency by Carlist supporters of a rival branch of the royal family.
All Latin American colonies win their independence, with Cuba, Puerto Rico and the Philippines in Asia lost during a disastrous war with the United States in 1898.
1936-39 - Spanish Civil War pits left-wing Republicans against right-wing Nationalists, with both sides receiving foreign support.
General Francisco Franco leads the Nationalists to victory, and remains in power till his death in 1975.
1975 - Franco dies. Succeeded as head of state by King Juan Carlos. Spain makes transition from dictatorship to democracy and withdraws from the Spanish Sahara, ending its colonial empire.
1978 - New constitution confirms Spain as a parliamentary monarchy.
1986 - Spain joins European Economic Community.
2017 - Madrid imposes direct rule in Catalonia after a referendum backs independence from Spain.
Read full timeline