Occupied since the Neolithic, Carcassonne is located in the Aude plain between two great axes of circulation linking the Atlantic to the Mediterranean sea and the Massif Central to the Pyrénées. Its strategic importance was quickly recognized by the Romans who occupied its hilltop until the demise of their western empire and was later taken over by the Visigoths in the fifth century who founded the city. Also thriving as a trading post due to its location, it saw many rulers who successively built up its fortifications up until its military significance was greatly reduced by the Treaty of the Pyrenees in 1659.
The city is famous for the Cité de Carcassonne, a medieval fortress restored by the theorist and architect Eugène Viollet-le-Duc in 1853 and added to the UNESCO list of World Heritage Sites in 1997. Consequently, Carcassonne greatly profits from tourism but also counts manufacture and wine-making as some of its other key economic sectors.
The first signs of settlement in this region have been dated to about 3500 BC, but the hill site of Carsac – a Celtic place-name that has been retained at other sites in the south – became an important trading place in the 6th century BC. The Volcae Tectosages fortified the oppidum.
Carcassonne became strategically identified when Romans fortified the hilltop around 100 BC and eventually made the colonia of Julia Carsaco, later Carcasum (by the process of swapping consonants known as metathesis). The main part of the lower courses of the northern ramparts dates from Gallo-Roman times. In 462 the Romans officially ceded Septimania to the Visigothic king Theodoric II who had held Carcassonne since 453; he built more fortifications at Carcassonne, which was a frontier post on the northern marches: traces of them still stand. Theodoric is thought to have begun the predecessor of the basilica that is now dedicated to Saint Nazaire. In 508 the Visigoths successfully foiled attacks by the Frankish king Clovis. Saracens from Barcelona took Carcassonne in 725, but King Pepin the Short (Pépin le Bref) drove them away in 759-60; though he took most of the south of France, he was unable to penetrate the impregnable fortress of Carcassonne.
In 1067, Carcassonne became the property of Raimond-Bernard Trencavel, viscount of Albi and Nîmes, through his marriage with Ermengard, sister of the last count of Carcassonne. In the following centuries, the Trencavel family allied in succession either with the counts of Barcelona or of Toulouse. They built the Château Comtal and the Basilica of St. Nazaire and St. Celse. In 1096, Pope Urban II blessed the foundation stones of the new cathedral.
In 1240, Trencavel's son tried to reconquer his old domain but in vain. The city submitted to the rule of the kingdom of France in 1247. Carcassonne became a border fortress between France and the Kingdom of Aragon under the Treaty of Corbeil (1258). King Louis IX founded the new part of the town across the river. He and his successor Philip III built the outer ramparts. Contemporary opinion still considered the fortress impregnable. During the Hundred Years' War, Edward the Black Prince failed to take the city in 1355, although his troops destroyed the Lower Town.
In 1659, the Treaty of the Pyrenees transferred the border province of Roussillon to France, and Carcassonne's military significance was reduced. Fortifications were abandoned, and the city became mainly an economic centre that concentrated on the woollen textile industry, for which a 1723 source quoted by Fernand Braudel found it "the manufacturing centre of Languedoc".