The history of Spain dates to contact between the pre-Roman peoples of the Mediterranean coast of the Iberian Peninsula with the Greeks and Phoenicians. During Classical Antiquity, the peninsula was the site of multiple successive colonizations of Greeks, Carthaginians, and Romans. Native peoples of the peninsula, such as the Tartessos, intermingled with the colonizers to create a uniquely Iberian culture. The Romans referred to the entire peninsula as Hispania, from which the name "Spain" originates. As was the rest of the Western Roman Empire, Spain was subject to numerous invasions of Germanic tribes during the 4th and 5th centuries AD, resulting in the end of Roman rule and the establishment of Germanic kingdoms, marking the beginning of the Middle Ages in Spain.
Germanic control lasted until the Umayyad conquest of Hispania began in 711. The region became known as Al-Andalus, and except for the small Kingdom of Asturias, the region remained under the control of Muslim-led states for much of the Early Middle Ages, a period known as the Islamic Golden Age. By the time of the High Middle Ages, Christians from the north gradually expanded their control over Iberia, a period known as the Reconquista. As they expanded southward, a number of Christian kingdoms were formed, including the Kingdom of Navarre, the Kingdom of León, the Kingdom of Castile, and the Kingdom of Aragon. They eventually consolidated into two roughly equivalent polities, the Crown of Castile and the Crown of Aragon. The early modern period is generally dated from the union of the Crowns of Castile and Aragon by royal marriage in 1469.