Tradition holds that Charles the Great (Charlemagne) granted a charter to the Andorran people for a contingent of five thousand soldiers under the command of Marc Almugaver, in return for fighting against the Moors near Porté-Puymorens (Cerdanya).