de Lòria, and in some places in Encamp, as well as in the Roc d'Enclar. People continued trading, mainly with wine and cereals, with the Roman cities of Urgellet (the present-day La Seu d'Urgell) and all across Segre through the via romana Strata Ceretana (also known as Strata Confluetana). Visigoths and Carolingians: the legend of Charlemagne After the fall of the Roman Empire, Andorra came under the influence of the Visigoths, the Kingdom of Toledo, and the Diocese of Urgell. The Visigoths remained in the valleys for 200 years, during which time Christianity spread. When the Muslim Empire of Al-Andalus replaced the ruling Visigoths in most of the Iberian Peninsula, Andorra was sheltered from these Arab invaders by the Franks. Tradition holds that Charles the Great (Charlemagne) granted a charter to the Andorran people for a contingent of 5,000 soldiers under the command of Marc Almugaver, in return for fighting against the Moors near Porté-Puymorens (Cerdanya). 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 the bishop of the Diocese of Urgell. Tradition also 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. In 988, Count Borrell II of Urgell gave the Andorran valleys to the Diocese of Urgell in exchange for land in Cerdanya. Since then, the bishop of Urgell, based in Seu d'Urgell, has been co-prince of Andorra. The first document that mentions Andorra as a territory is the Acta de Consagració i Dotació de la Catedral de la Seu d'Urgell (Deed of Consecration and Endowment of the Cathedral of La Seu d'Urgell). The document, dated 839, depicts the six old parishes of the Andorran valleys that made up the country's administrative division. Medieval Age: The Paréages and the founding of the Co-Principality Before 1095, Andorra had no military protection, and the bishop of Urgell, who knew that the count of Urgell wanted to reclaim the Andorran valleys, asked the Lord of Caboet for help and protection. In 1095, the lord of Caboet and the bishop of Urgell signed under oath a declaration of their co-sovereignty over Andorra. Arnalda de Caboet, daughter of Arnau of Caboet, married the viscount of Castellbò. Their daughter, Ermessenda de Castellbò, married the