The territory that now constitutes the nationality and autonomous community of Catalonia in Spain was first settled during the Middle Palaeolithic era. Like the rest of the Mediterranean side of the Iberian Peninsula, the area was occupied by the Iberians and several Greek and Carthaginian towns were established on the coast before the Roman conquest.
The area that is now Catalonia was the first area of Hispania conquered by the Romans. It then came under Visigothic rule after collapse of the western part of the Roman Empire. In 718, the area was occupied by the Moors and became a part of Muslim ruled al-Andalus. The Frankish Empire conquered the area from the Muslims, beginning with the conquest of Roussillon in 760 and ending with the conquest of Barcelona in 801, as part of the creation of a larger buffer zone of Christian counties known as the Marca Hispanica.
In time, the counties of the region gave up their allegiance to the rulers of the Franks and their successors and became attached, as a self-governing principality under the Count of Barcelona, to the Crown of Aragon. The Principality of Catalonia became the main base for the Crown of Aragon's naval power and expansionism, that spread into Valencia, the Balearic Islands, and later into Sardinia, Sicily, Naples and, briefly, Athens. An identifiably Catalan culture developed in the later Middle Ages under the hegemony of the counts of Barcelona.