The first inhabitants of Cerdanya probably spoke a language related to the old Basque language and to Aquitanian. Many place names testify to this.
In the first millennium BC came the Iberians from the south. Although their identity is still a matter of debate, some theories posit that they spoke an Afro-Asiatic language, and that they separated from the Berbers in North Africa and moved into Spain and then further north to the south of modern-day France. In Cerdanya they probably mixed with the native inhabitants, and the resulting people were known as the Kerretes, from the native word ker or kar, meaning rock, related to old Basque karri (modern Basque harri), stone.
The Kerretes were probably essentially of Basque and Aquitanian-related stock, as the Iberian clans who mixed with the native inhabitants can have comprised only small numbers of people. The Kerretes retained a language related to old Basque and Aquitanian, although some Iberian words may have entered the language, and Iberians probably occupied positions at the top of the Kerrete society.
The main oppidum of the Kerretes, commanding the whole country, was called Kere and was built on the hill above the modern-day village of Llívia (a Spanish exclave in French territory). Later the Kerretes came under Roman rule, and the Romans renamed the oppidum Julia Lybica, with a significant number of Roman citizens settling there. During the Roman Empire, the area of Cerdanya was a pagus known as pagus Liviensis (a name derived from its capital Julia Lybica), part of the province of Hispania Tarraconensis. The pagus Liviensis was itself divided in two: the eastern part around Julia Lybica was known as Cerretania Julia, while the western part was known as Cerretania Augusta. The name Cerdanya comes from Cerretania, itself coming from the old name of the inhabitants, the Kerretes. As for Julia Lybica, the name evolved into Julia Livia and then Llívia.
The Kerretes seem to have kept their old language until very late, probably as late as the 8th or 9th century. Romanization in the area was extremely slow, even though eventually the native language gave way, and the people in Cerdanya ended up speaking Catalan, a language derived from Latin. At the end of the Roman Empire, Julia Lybica entered a period of decadence, and lost much of its importance. It is around this time that the town of La Seu d'Urgell (in Catalonia, but outside of Cerdanya) started to replace Julia Lybica as the main center of population in that area of northern Catalonia, and in the 6th century when the diocese (bishopric) of Urgell was founded, Cerdanya was inside its limits.
Devastated by the Vandals and other Germanic tribes, Cerdanya was part of the Visigothic kingdom of Toulouse and later Toledo, until eventually it was conquered by the Muslims. After Muslim expansion was halted by Odo the Great in the Battle of Toulouse (721), the Berber commander Uthman ibn Naissa established a small realm in Cerdanya and allied with Odo, so that the Aquitanian leader could secure his south-eastern borders. However, Uthman ibn Naissa came next under Umayyad attack and the Berber lord was defeated, opening the way to Abdul Rahman Al Ghafiqi's expedition into Aquitaine. During Abd al-Rahman I´s military campaign across the Ebro region (781), the Cordovan commander received the submission of Ibn Belaskut, or Galindo Belascotenes, in Cerdanya. Under Carolingian pressure, Cerdanya became a Frankish vassal about 785.
- County of Cerdanya
The county of Cerdanya has its origin in the Spanish Marches established by Charlemagne. In the 9th century Cerdanya was one of the lordships united in the person of the counts of Barcelona, who were also counts of Girona, Narbonne and Urgell. Wilfred the Hairy (count 870–897) had three sons and established the youngest, Miron (died 927), as Count of Cerdanya, a sovereign state.
The ancient counties of Rosselló and Cerdanya on a present-day political map
The sovereign county of Cerdanya bordered the county of Urgell, the county of Barcelona, the county of Besalú, the county of Roussillon, and the county of Razès. The county of Cerdanya was made up of Cerdanya proper with the addition of other areas which it managed to acquire over time through inheritance, such as Capcir and Conflent. Thus, the county of Cerdanya was actually quite an important county. The counts of Cerdanya were great patrons of abbeys, most famously Saint-Michel de Cuxa (Catalan: Sant Miquel de Cuixà), dating back to the 10th century and located in Conflent, and Saint-Martin-du-Canigou (Catalan: Sant Martí del Canigó), dedicated by Count Guifred of Cerdanya in 1009.
However, the line of the counts died out in 1117 and the county was inherited by the counts of Barcelona, later to become kings of Aragon.
The modern natural comarca of Cerdanya in Catalonia and Pyrénées-Orientales.
Cerdanya proper was split between Spain and France by the Treaty of the Pyrenees of 1659, with the north of Cerdanya becoming French, while the south of Cerdanya remained Spanish. The counties of Rosselló, Capcir and Conflent also became French at that time.
Today, the Catalan side of Cerdanya is a Catalan comarca known as Baixa Cerdanya (i.e. "Lower Cerdanya"), and whose capital is Puigcerdà. Puigcerdà was already the capital of Cerdanya before the division of 1659, having replaced Hix in 1178 as capital of Cerdanya. Hix, the place where the counts of Cerdanya resided, is now a village inside the commune of Bourg-Madame on the French side of the border. Hix had itself replaced Llívia, which was the ancient capital of Cerdanya in Antiquity. At the Treaty of the Pyrenees it was decided that Llívia would remain Spanish (allegedly because the treaty stipulated that only villages were to be ceded to France, and Llívia was considered a city and not a village, due to its status as the ancient capital of Cerdanya), so Llívia is now an exclave of Spain inside French territory.
The French side of Cerdanya is part of the département of Pyrénées-Orientales and has no particular status. People in France refer to it as Cerdagne française (that is, "French Cerdanya"), or just Cerdagne, while people on the Spanish side refer to it as Alta Cerdanya ("Upper Cerdanya"). Its main towns are Bourg-Madame and the ski resort of Font-Romeu.
Despite the split between France and Spain, ties remain between families on both sides of the border and, obviously, the area has logically ever since had a lot of trafficking from one country to the other. During World War I, Cerdanya has been the place of an important smuggling trade in which horses and mules went from French to Spanish Cerdanya, before being sold to the French army and going back to France through the Le Perthus.