 Besalú and Empúries were originally part of Girona.In 797, in the greatest military triumph of his long career, the young Louis took Barcelona, the greatest city of the Catalan littoral.When Urgell and Cerdanya were subdued around 798, they were also made counties and Borrell was made count.