Archaeological findings indicate that the region now known as Spain has been inhabited for thousands of years. A shrine near Santander, discovered in 1981, is believed to be over 14,000 years old, and the paintings discovered in the nearby caves of Altamira in 1879 are of comparable antiquity. The recorded history of Spain begins about 1000 BC , when the prehistoric Iberian culture was transformed by the invasion of Celtic tribes from the north and the coming of Phoenician and Greek colonists to the Spanish coast. From the 6th to the 2nd century BC , Carthage controlled the Iberian Peninsula up to the Ebro River; from 133 BC , with the fall of Numantia, until the barbarian invasions of the 5th century AD , Rome held Hispania, from which the name Spain is derived. During the Roman period, cities and roads were built, and Christianity and Latin, the language from which Spanish originated, were introduced. In the 5th century, the Visigoths, or western Goths, settled in Spain, dominating the country until 711, when the invading Moors defeated King Roderick. All of Spain, except for a few northern districts, knew Muslim rule for periods ranging from 300 to 800 years. Under Islam, a rich civilization arose, characterized by prosperous cities, industries, and agriculture and by brilliant writers, philosophers, and physicians, including Jews as well as Muslims. Throughout this period (711–1492), however, Christian Spain waged intermittent and local war against the Moors. The most prominent figure in this battle was El Cid, who fought for both Christians and Moors in the 11th century. By the 13th century, Muslim rule was restricted to the south of Spain. In 1492, Granada, the last Moorish stronghold on Spanish soil, fell, and Spain was unified under Ferdinand II of Aragón and Isabella I of Castile, the "Catholic Sovereigns." Until then, Aragón (consisting of Aragón, Catalonia, Valencia, and the Balearic Islands) had been an independent kingdom, which had expanded toward the eastern Mediterranean, incorporating Sicily and Naples, and had competed with Genoa and Venice. In order to strengthen the unity of the new state, Moors and Jews were expelled from Spain; Catholic converts who chose to stay were subject to the terrors of the Inquisition if suspected of practicing their former religions. The year 1492 also witnessed the official European discovery of the Americas by Christopher Columbus, sailing under the Castilian flag. In 1519, Ferdinand Magellan, a Portuguese in the service of Spain, began the first circumnavigation of the world, completed in 1522 by Juan Sebastián Elcano.
The 16th century, particularly under Charles I, who was also Holy Roman Emperor Charles V, was the golden age of Spain: its empire in the Americas produced vast wealth; its arts flourished; its fleet ruled the high seas; and its armies were the strongest in Europe. By the latter part of the 16th century, however, under Philip II, the toll of religious wars in Europe and the flow of people and resources to the New World had drained the strength of the Spanish nation; in 1588, the "invincible" Spanish Armada was defeated by England. Spain's continental power was ended by wars with England, the Netherlands, and France in the 17th century and by the War of the Spanish Succession (1701–14), which also established the Bourbon (Borbón) dynasty in Spain. In 1808, the enfeebled Spanish monarchy was temporarily ended, and Napoleon Bonaparte's brother Joseph was proclaimed king of Spain. On 2 May 1808, however, the Spanish people revolted and, later assisted by the British, drove the French from Spain. In the post-Napoleonic period, the Bourbons were restored to the Spanish throne, but a spirit of liberalism, symbolized by the 1812 Constitution of Cádiz, remained strong.
Much of the 19th and early 20th centuries was consumed in passionate struggles between radical republicanism and absolute monarchy. Abroad, imperial Spain lost most of its dominions in the Western Hemisphere as a result of colonial rebellions in the first half of the 19th century; Cuba, Puerto Rico, and the Philippines were lost as a result of the Spanish-American War in 1898. Spain remained neutral in World War I but in the postwar period engaged in extensive military action to maintain its colonial possessions in Morocco.
The constitution of December 1931 defined Spain as a "democratic republic of workers," with "no official religion," respecting the "rules of international law … renouncing war as an instrument of national policy and recognizing the principle of regional autonomy." Neither right nor left had a parliamentary majority, and on the whole the coalition governments were ineffective. On 17 July 1936, an army revolt against the republic took place in Spanish Morocco. On the following day, Gen. Francisco Franco landed in Spain, and for the next two and a half years, until 31 March 1939, Spain was ravaged by civil war. The two contending parties were the Republicans, made up partly of democrats and partly of antidemocratic left-wing groups, and the rebels (Nationalists), who favored the establishment of a rightwing dictatorship. Almost from the beginning, a number of foreign countries intervened. Germany and Italy furnished manpower and armaments to the Nationalists, while the USSR, Czechoslovakia, and Mexico supported the Republicans. Finally the Republicans were defeated, and General Franco formed a corporative state. Under the Franco regime, Spain gave aid to the Axis powers in World War II but was itself a nonbelligerent. Early defeats in the Moroccan campaign paved the way in 1923 for the benevolent dictatorship of Primo de Rivera, who successfully ended the war in 1927 and remained in power under the monarchy until 1930. In 1931, after municipal elections indicated a large urban vote in favor of a republic, Alfonso XIII left Spain and a republic was established.
Diplomatically isolated following the end of World War II, Spain in succeeding decades improved its international standing, in part by signing economic and military agreements with the United States in 1953 and 1963. Spain was admitted to the UN in 1955. While relations with its European neighbors approached normality, the repressive nature of the Franco regime kept Spain apart from the main social, political, and economic currents of postwar Western Europe.
On 22 July 1969, Juan Carlos de Borbón y Borbón was officially designated by Franco as his successor, to rule with the title of king; formally, Franco had been ruling as regent for the prince since 1947. On 20 November 1975, Gen. Franco died at the age of 82, thus ending a career that had dominated nearly four decades of Spanish history. Two days later, Juan Carlos I was sworn in as king. He reconfirmed Carlos Arias Navarro as prime minister on 5 December. Despite Juan Carlos I's announcement, in early 1976, of a program of moderate political and social reform, the new government was received with widespread demonstrations by labor groups and Catalan and Basque separatists. Continued political unrest, coupled with a sharp rise in living costs, led ultimately to the king's dismissal of Arias Navarro, who was replaced, on 7 July, by Adolfo Suárez González.
On 15 June 1977, the first democratic elections in Spain in 40 years took place, with the Union of the Democratic Center (Unión de Centro Democrático—UCD), headed by Suárez, winning a majority in the new Cortes. The Cortes prepared a new constitution (in many respects similar to that of 1931), which was approved by popular referendum and sanctioned by the king in December 1978. In the elections of March 1979, the UCD was again the victor, and in the April local elections it captured more than 75% of the municipalities.
When Suárez announced his resignation in January 1981, the king named Leopoldo Calvo Sotelo y Bustelo to the premiership. As the Cortes wavered over the appointment, a group of armed civil guards stormed parliament on 23 February and held more than 300 deputies hostage for 17 hours. The attempted coup was swiftly neutralized by the king, who secured the loyalty of other military commanders. The plotters were arrested, and Sotelo was swiftly confirmed. A year of political wrangling followed; by mid-1982 the UCD was in disarray, and Sotelo called new elections. In October 1982, the Spanish Socialist Worker's Party (Partido Socialista Obrero Español—PSOE), headed by Felipe González Márquez, won absolute majorities in both houses of parliament. The new government was characterized by its relative youthfulness—the average age of cabinet ministers was 41—and by the fact that its members had no links with the Franco dictatorship. In the 1986 and 1989 elections, the PSOE again won majorities in both houses of parliament. The PSOE failed to win a majority in 1993 but governed with the support of the Basque and Catalan nationalist parties.
A continuing problem since the late 1960s has been political violence, especially in the Basque region. Political murders and kidnappings, mainly perpetrated by the separatist Basque Nation and Liberty (Euzkadi ta Askatasuna), commonly known as ETA, by the Antifascist Resistance Groups (GRAPO), and by several right-wing groups, abated only slightly in recent years. Another uncertainty in Spain's political future was the role of the military. Several army officers were arrested in October 1982 on charges of plotting a pre-election coup, which reportedly had the backing of those involved in the February 1981 attempt. Spain joined NATO in 1982, but the membership question became so controversial that a referendum on it was held in March 1986; about two-thirds of the electorate voted, and 53% chose continued NATO membership. On 1 January of that year, Spain became a full member of the EC (now EU). In January 1988, the United States, acceding to Spain's demands, agreed to withdraw 72 jet fighters based near Madrid.
Spain received considerable recognition with the holding of the 1992 Summer Olympics in Barcelona, and Expo 92, a world's fair, in Sevilla. Other notable events included the designation of Madrid as the culture capital of Europe in 1992.
Throughout 1995–2000 Basque terrorists continued their attacks on civilian, police, and military targets and began to target more visible political targets. In August of 1995, the terrorists came close to assassinating King Juan Carlos while he was vacationing on the island of Majorca, off the southeastern coast of Spain. In 1997 Basque terrorists killed an important Socialist official of one of the Basque regions. In 2000, Jose Luis Lopez de la Calle, a Madrid newspaper columnist who was outspoken in his criticism of the Basque group, ETA, was shot to death outside his home. Thousands marched in the streets to protest his killing.
In 1995 information came to light that revealed that from 1983 to 1987 government officials in cooperation with the Civil Guard (Spain's national police force) formed death squads to hunt down and kill Basque terrorists living in France. The squads were disbanded after France agreed to greater cooperation with Spanish authorities, but not before 27 suspected Basque terrorists had been killed. The existence of the death squads may have remained a secret, but two death squad members were caught in the course of an attack and prosecuted for murder. At first government officials secured the silence of these two men by agreeing to make yearly payments to their wives, but by 1994 they felt that the story should no longer be hidden and revealed it to the world from their jail cells. Initially, Prime Minister Gonzalez had been charged with having knowledge of the attacks but an official inquiry into the charges concluded that they were groundless and he was completely exonerated.
Although French and Spanish security officials worked together to combat terrorism, violence attributed to the Basque terrorists continued into 2003. However, public support for Basque terrorists had waned nearly completely. A 1996 Basque execution of a kidnapped university professor brought out almost a half-million protesters in Madrid alone denouncing the Basque terrorists. A year later and again in 2000, assassinations allegedly carried out by Basque terrorists triggered large protests as well. The ETA was suspected of being behind bombings in several tourist resorts in June 2002 as an EU summit was held in Seville. In February 2003, Basque Socialist Party activist Joseba Pagazaurtundua was assassinated; the shooting was attributed to the ETA. Batasuna, the separatist Basque political party believed to be the political arm of the ETA (although it denies this charge), was banned by the Supreme Court in March 2003. This ban prevented Batasuna candidates from running in municipal elections in May 2003.
As Spain attempts to hold itself together against regional separatism, it joined with seven other nations in 1995 to create a passport-free zone that allowed much greater mobility between them. Spain also rejoined the NATO Military Command in the mid-1990s, making it once again a full member of the alliance. The adjustments to Spain's economy carried out in the mid- and late-1990s were successful. As a result, Spain was one of the 11 countries that joined together in launching the euro, the European Union's single currency, on 1 January 1999. (Greece jointed shortly thereafter, bringing the number of countries in the euro zone to 12.)
On 11 July 2002, 12 Moroccan frontier guards landed on the island of Perejil, which is claimed by Spain, and claimed it as Moroccan territory. Spain's Prime Minister José María Aznar opposed the occupation, and sent troops to evacuate the Moroccan guards. Diplomatic relations between Spain and Morocco improved in December 2002, when plans were made for the return of each state's ambassadors.
During the months following the 8 November 2002 passage of UN Security Council resolution 1441, which called on Iraq to disarm itself of weapons of mass destruction, Aznar affirmed Spain's support for the United States and British position on the use of military force, to force Iraq to disarm. Over 90% of Spain's citizens were against a war in Iraq, which began on 19 March 2003, and Spain's pro-US stance alienated France and Germany, among other nations opposing the use of military force. Spain did not commit combat troops to fight alongside US and British forces, but it sent 900 troops trained in medical support and antimine specialties to assist the coalition forces.