Charlemagne was the king of the Franks, the Lombards and Emperor of the West, he established the bases of what will become the European medieval kingdoms. According to the legend, the Emperor Charlemagne continued the work of pushing the Saracens back to the Iberian Peninsula, which was started by his grandfather Charles Martel. Its passage through the Pyrenean lands was a response to the request for help made by the inhabitants of the valley of Valira, who had to flee before the arrival of the Arabs.