Tradition holds that Charlemagne granted a charter to the Andorran people in return for their fighting against the Moors.
In the 11th century, a dispute arose between the bishop of Urgell and the count of Foix.