Caliph Al Hakam II opened many libraries in addition to the many medical schools and universities which existed at the time, making Córdoba a centre for education. During these centuries it became the center of a society ruled by Muslims, in which all other groups had a second-class status. It was recaptured by Christian forces in 1236, during the Reconquista. The historic centre was named a UNESCO World Heritage Site.
The first traces of human presence in the area are remains of a Neanderthal Man, dating to c. 42,000 to 35,000 BC. In the 8th century BC, during the ancient Tartessos period, a pre-urban settlement existed. The population gradually learned copper and silver metallurgy. The first historical mention of a settlement dates to the Carthaginian expansion across the Guadalquivir, when general Hamilcar Barca renamed it Kartuba, from Kart-Juba, meaning "the City of Juba", a Numidian commander who had died in a battle nearby. Córdoba was conquered by the Romans in 206 BC and named as Corduba.
In 169 Roman consul M. Claudius Marcellus, grandson of Marcus Claudius Marcellus, who had governed both Further and Hither Spain, founded a Latin colony alongside the pre-existing Iberian settlement. Between 143 and 141 BC the town was besieged by Viriatus. A Roman forum is known to have existed in the city in 113 BC. The famous Cordoba Treasure, with mixed local and Roman artistic traditions, was buried in the city at this time; it is now in the British Museum.
It became a colonia with the title Patricia, between 46 and 45 BC. It was sacked by Caesar in 45 due to its Pompeian allegiance, and settled with veterans by Augustus. It became capital of Baetica and had a colonial and provincial forum and many temples. It was the chief center of Roman intellectual life in Hispania Ulterior (Further Spain). Its republican poets were succeeded by Seneca and Lucan.