The original peoples of the Iberian peninsula, consisting of a number of separate tribes, are given the generic name of Iberians. This may have included the Basques, the only pre-Celtic people in Iberia surviving to the present day as a separate ethnic group. The most important culture of this period is that of the city of Tartessos. Beginning in the 9th century BC, Celtic tribes entered the Iberian peninsula through the Pyrenees and settled throughout the peninsula, becoming the Celt-Iberians.
The seafaring Phoenicians, Greeks and Carthaginians successively settled along the Mediterranean coast and founded trading colonies there over a period of several centuries.
Around 1,100 BC Phoenician merchants founded the trading colony of Gadir or Gades (modern day Cádiz) near Tartessos. In the 8th century BC the first Greek colonies, such as Emporion (modern Empúries), were founded along the Mediterranean coast on the East, leaving the south coast to the Phoenicians. The Greeks are responsible for the name Iberia, after the river Iber (Ebro in Spanish). In the 6th century BC the Carthaginians arrived in Iberia while struggling with the Greeks for control of the Western Mediterranean. Their most important colony was Carthago Nova (Latin name of modern day Cartagena).
The Romans arrived in the Iberian peninsula during the Second Punic war in the 2nd century BC, and annexed it under Augustus after two centuries of war with the Celtic and Iberian tribes and the Phoenician, Greek and Carthaginian colonies becoming the province of Hispania. It was divided in Hispania Ulterior and Hispania Citerior during the late Roman Republic; and, during the Roman Empire, Hispania Taraconensis in the northeast, Hispania Baetica in the south and Lusitania in the southwest.
From the 8th to the 15th centuries, parts of the Iberian peninsula were ruled by Muslims (the Moors) who had crossed over from North Africa. Christian and Muslim kingdoms fought and allied among themselves. The Muslim taifa kings competed in patronage of the arts, the Way of Saint James attracted pilgrims from all Western Europe and the Jewish population of Iberia set the basis of Sephardic culture. Much of Spain's distinctive art originates from this seven-hundred-year period, and many Arabic words made their way into Spanish and Catalan, and from them to other European languages.
The Moorish capital was Córdoba, in the southern portion of Spain known as Andalucía. During the time of Arab occupation, most of the Iberian peninsula was in relative peace, with large populations of Jews, Christians and Muslims living in close quarters; the official language of most of Spain was Arabic.
The Reconquista ended in 1492, when Fernando and Isabel captured Granada, the last Moorish city in Spain. They then expelled all Muslims and Jews from their new Christian kingdom. This was also the year that the king and queen funded Columbus' trip to the New World.
By 1512, most of the kingdoms of present-day Spain were politically unified, although not as a modern centralized state. The grandson of Isabel and Fernando, Carlos I, extended his crown to other places in Europe and the rest of the world. The unification of Iberia was complete when Carlos I's son, Felipe II, became King of Portugal in 1580, as well as of the other Iberian Kingdoms (collectively known as "Spain" since this moment).
During the 16th century,with Carlos I and Felipe II, Spain became the most powerful European nation, its territory covering most of South and Central America, Asia - Pacific, the Iberian peninsula, southern Italy, Germany, and the Low Countries. This was later known as the Spanish Empire.
It was also the wealthiest nation but the uncontrolled influx of goods and minerals from Spanish colonisation of the Americas resulted in rampant inflation and economic depression.
In 1640, under Felipe IV, the centralist policy of the Count-Duke of Olivares provoked wars in Portugal and Catalonia. Portugal became an independent kingdom again and Catalonia enjoyed some years of French-supported independence but was quickly returned to the Spanish Crown, except Rosellon.
A series of long and costly wars and revolts followed in the 17th century, beginning a steady decline of Spanish power in Europe. Controversy over succession to the throne consumed the country during the first years of the 18th century (see War of the Spanish Succession). It was only after this war ended and a new dynasty was installed - the French Bourbons (see House of Bourbon) - that a centralized Spanish state was established and the first Borbon king Philip V of Spain in 1707 cancelled the Aragon court and changed the title of king of Castilla and Aragon for the current king of Spain.
Spain was occupied by Napoleon in the early 1800s, but the Spaniards rose in arms. After the War of Independence (1808-1814), a series of revolts and armed conflicts between Liberals and supporters of the ancien régime lasted throughout much of the 19th century, complicated by a dispute over dynastic succession by the Carlists which led to three civil wars. After that, Spain was briefly a Republic, from 1871 to 1873, a year in which a series of coups reinstalled the monarchy.
In the meantime, Spain lost all of its colonies in the Caribbean region and Asia-Pacific region during the 19th century, a trend which ended with the loss of Cuba, Puerto Rico, Philippines and Guam to the United States after the Spanish-American War of 1898.
The 20th century initially brought little peace; colonisation of Western Sahara, Spanish Morocco and Equatorial Guinea was attempted. A period of dictatorial rule (1923-1931) ended with the establishment of the Second Spanish Republic. The Republic offered political autonomy to the Basque Country and Catalonia and gave voting rights to women. However, with increasing political polarisation, anti-clericalism and pressure from all sides, coupled with growing and unchecked political violence, the Republic ended with the outbreak of the Spanish Civil War in July 1936. Following the victory of the nationalist forces in 1939, General Francisco Franco ruled a nation exhausted politically and economically.
After World War II, being one of few surviving fascist regimes in Europe, Spain was politically and economically isolated and was kept out of the United Nations until 1955, when it became strategically important for U.S. president Eisenhower to establish a military presence in the Iberian peninsula. This opening to Spain was aided by Franco's opposition to commuSnism. In the 1960s, more than a decade later than other western European countries, Spain began to enjoy economic growth and gradually transformed into a modern industrial economy with a thriving tourism sector. Growth continued well into the 1970s, with Franco's government going to great lengths to shield the Spanish people from the effects of the oil crisis.
Upon the death of the dictator General Franco in November 1975, his personally-designated heir Prince Juan Carlos assumed the position of king and head of state. With the approval of the Spanish Constitution of 1978 and the arrival of democracy.