History of Andorra
Andorra claims it is the last independent survivor of the Marca Hispanica. This was the buffer states created by Charlemagne to keep the Islamic Moors from advancing into Christian France. According to the tradition, Charlemagne granted a charter to the Andorran  people in return for their fighting the Moors.  In the 9th century,  Charlemagne's grandson, Charles the Bald, named the Count of Urgell as overlord of Andorra. A descendant of the count later gave the lands to the Diocese of Urgell.