Llívia is a small Catalan town which is an exclave of Spain, being surrounded by France. The Spanish border is about one kilometre away. The town is part of Cerdanya, province of Girona. The French territory surrounding Llivia is the Pyrénées-Orientales département. Llivia had a total population of 1252 in 2005.
People lived there in Roman times. Originally, the settlement was a Roman fort (known as an oppidum). The name of the oppidum was Julia Libica. Llivia was the capital of Cerdagne in antiquity, but in the early Middle Ages, Hix (a commune of Bourg-Madame, France) became the capital of the region.