Llívia was the site of an Iberian oppidum which commanded the region and was named "Julia Lybica" by the Romans. It was the ancient capital of Cerdanya in antiquity, before being replaced by Hix (commune of Bourg-Madame, France) in the Middle Ages. During the Visigothic period, its citadel, the "castrum Libiae", was held by the rebel Paul of Narbonne against King Wamba in 672. As the "town (or 'city') of Cerdanya," 8th century Llívia may also have been the scene of the siege by which governor Abdul Rahman Al Ghafiqi of Muslim Spain rid himself of the Moorish (Berber) rebel Uthman ibn Naissa ("Munnuza"), who had allied himself with Duke Eudo of Aquitaine to improve the chances of his rebellion, ahead of the Battle of Tours (732 or 733), also known as the Battle of Poitiers.