Llívia has been inhabited continuously from the end of the Bronze Age to the present day, and the settlement has alternated from the hilltop and the foothills. This enclave in France was also the capital of the region until Puigcerdà was founded (1177-1178), and was always an important military stronghold. Its importance was such that King Charles I, in 1528, granted it the title of "Vila", or town. Thanks to this, Llívia remained under Spanish sovereignty after the Treaty of the Pyrenees and Llívia (1659-1660).
This section provides a summary of this unique story, covering the periods when Llívia was the centre or capital, and the periods when, due to the political climate, it lost out to other nearby populations.