Marca Hispanica
Andorra remained part of the Frankish "Marca Hispanica", the buffer-zone between the Frankish Empire and the Muslim territories, Andorra being part of the territory ruled by the Count of Urgell and eventually by the bishop of the Diocese of Urgell. Also tradition holds that it was guaranteed by the son of Charlemagne, Louis the Pious, writing the "Carta de Poblament" or a local municipal charter circa 805.