For millennia the Iberian peninsula has been a crossroads between Europe and Africa, the Mediterranean and the Atlantic. That position explains the great variety of peoples who lived there and the complexity of a history in which political unity came late and never erased regional identities (see the autonomous communities).
Origins
Human traces in the peninsula are very ancient: at Atapuerca, near Burgos, remains of hominins over 800,000 years old have been found, among the oldest in Europe. In the Upper Palaeolithic, hunters painted the caves of Altamira and the whole Cantabrian coast (see prehistoric art). In the first millennium BC the peninsula was inhabited by the Iberians in the south and east and by Celtic peoples in the centre and north; their meeting produced the Celtiberians. Traders came to the coasts: the Phoenicians, who by tradition founded Gadir, today's Cádiz, around 1100 BC; the Greeks, who founded Emporion, today's Empúries; and the Carthaginians, who made the peninsula a province and founded Carthago Nova, today's Cartagena.
Roman and Visigothic Hispania
The Second Punic War brought the Romans to Spain in 218 BC, but complete conquest took almost two centuries, until Augustus's Cantabrian wars. For six centuries Hispania was one of the most Romanised provinces of the empire: it gave Rome the emperors Trajan, Hadrian and Theodosius, the philosopher Seneca and the poet Martial, and left Latin, law, roads and monuments such as the aqueduct of Segovia and the theatre of Mérida (see ancient art). In the early fifth century came Vandals, Suebi and Alans, then the Visigoths, who founded a kingdom with its capital at Toledo. In 589 King Reccared converted to Catholicism, uniting the kingdom in religion.
Al-Andalus and the Reconquista
In 711 an Arab and Berber army led by Tariq crossed the Strait of Gibraltar and within a few years conquered almost the whole peninsula. Al-Andalus was born, and through the emirate and then the Caliphate of Córdoba it was for centuries one of the most learned and prosperous centres in Europe (see Muslim Spain). In the northern mountains small Christian nuclei survived, such as the kingdom of Asturias, where tradition places the victory of Covadonga in 722. From there began a long advance southwards, the Reconquista, which lasted almost eight centuries and was made of wars but also of long periods of coexistence. The kingdoms of León, Castile, Navarre, Aragon and Portugal and the county of Barcelona took shape. Decisive milestones were the capture of Toledo in 1085, the Christian victory at Las Navas de Tolosa in 1212 and the conquests of Córdoba (1236) and Seville (1248). This is the age of El Cid and the Way of St James.
The Catholic Monarchs and the empire
The marriage of Isabella of Castile and Ferdinand of Aragon in 1469 united the two most powerful crowns. 1492 was a pivotal year: the Catholic Monarchs took Granada, the last Muslim kingdom; decreed the expulsion of Jews who refused baptism; and financed the voyage of Christopher Columbus, who reached America. In 1512 Ferdinand annexed Navarre. Their grandson Charles I, elected emperor as Charles V in 1519, also inherited the Habsburg lands, southern Italy and Flanders: an empire "on which the sun never set", which with the conquest of Mexico and Peru spread across much of the Americas (see the Spanish Empire). His son Philip II made Madrid the capital (1561), built El Escorial, defeated the Turks at Lepanto in 1571 and in 1580 also became king of Portugal, but saw the defeat of the Armada against England in 1588.
The seventeenth century was the Golden Age of the arts, with Cervantes, Lope de Vega, Velázquez and Murillo (see literature and seventeenth-century art), but also a century of political and economic decline: the expulsion of the Moriscos in 1609, the revolts of Catalonia and Portugal in 1640, and Portuguese independence recognised in 1668.
The Bourbons and the nineteenth century
When Charles II died without heirs in 1700, the crown passed to Philip V of Bourbon, grandson of Louis XIV. The War of the Spanish Succession (1701-1714) ended with the loss of the European possessions and Gibraltar, and with the Nueva Planta decrees abolishing the institutions of the kingdoms of the Crown of Aragon. The eighteenth century was the age of Enlightenment reforms, above all under Charles III, formerly king of Naples.
In 1808 Napoleon imposed his brother Joseph as king: the War of Independence followed, immortalised by Goya, and in 1812 the Cortes of Cádiz approved the first liberal constitution. The return of Ferdinand VII brought back absolutism, while between 1810 and 1825 almost all the American colonies won independence. The nineteenth century was unstable, with the Carlist wars, military coups (pronunciamientos), the brief reign of Amadeo of Savoy (1871-1873) and the First Republic (1873-1874). The Restoration of 1874 brought back the Bourbons. In 1898 the war with the United States cost Spain Cuba, Puerto Rico and the Philippines: the "Disaster" that inspired the Generation of '98.
Republic, civil war and Francoism
After the dictatorship of General Miguel Primo de Rivera (1923-1930), the municipal elections of 1931 led to the proclamation of the Second Republic and the exile of Alfonso XIII. The Republic launched agrarian, secular and devolution reforms amid great tension. In July 1936 part of the army rose against the Popular Front government: the civil war began, lasting until 1 April 1939 and ending in victory for General Francisco Franco. Almost forty years of dictatorship followed: years of repression and isolation, then, from the 1960s, of economic growth driven by tourism and emigration.
Democracy
Franco died on 20 November 1975 and King Juan Carlos I, with prime minister Adolfo Suárez, led the transition to democracy: the first free elections in 1977, the 1978 Constitution, the failed coup of 23 February 1981. With Felipe González's Socialist victory in 1982 Spain joined NATO and, in 1986, the European Community. 1992, with the Barcelona Olympics and the Seville Expo, symbolised the new, modern Spain. The governments of José María Aznar, José Luis Rodríguez Zapatero, Mariano Rajoy and, from 2018, Pedro Sánchez followed, along with the great economic crisis after 2008, the Catalan crisis of 2017 and Juan Carlos's abdication in favour of Felipe VI in 2014. For the latest developments see Spain today and Spanish politics.