Catalan counties

The Catalan counties (Comtats Catalans, ) were those surviving counties of the Hispanic March and the southernmost part of the March of Gothia that were later united to form the Principality of Catalonia.

In 778, Charlemagne led the first military Frankish expedition into Hispania to create the Hispanic March, a military buffer zone between the Emirate of Córdoba of Al-Andalus and the Frankish Empire. The territory that he subdued would in later centuries be the kernel of Catalonia (not yet known like that since the first written mention of Catalonia is in 1113). In 781, Charlemagne made his 3-year-old son Louis the Pious (778 – 840) king of Aquitaine, who was sent there with regents and a court in order to secure the southern border of his kingdom against the Arabs and Moors and to expand southwards into Muslim territory.

These counties were originally feudal entities ruled by a small military elite. Counts were appointed directly by and owed allegiance to the Carolingian (Frankish) emperor. The appointment to heirs could not be taken for granted. However, with the rise of the importance of the Bellonids and strong figures among them such as, Sunifred (fl. 844–848) and Wilfred the Hairy (c.870-897), and the weakening of Carolingian royal power, the appointment of heirs eventually become a formality. This trend resulted in the counts becoming de facto independent of the Carolingian crown under Borrell II in 987, starting since, to call themselves and to be known as dei gratia comes (counts by the grace of god) and dux catalanensis (Catalan dukes) or even Hispaniae subjogator (attorney of Hispania) and Propugnator et murus christiani populi (wall and defender of the Christian folk).

The many counties (aside from the counties of County of Pallars, County of Urgell and County of Empuries) were to be soon absorbed into the County of Barcelona. A Count of Barcelona, prince Ramon Berenguer IV, married princess Petronilla of Aragon of the Kingdom of Aragon in 1150, uniting as equals the County of Barcelona and the Kingdom of Aragon. Thus, their son, Alfonso II of Aragon, became the first king of the Crown of Aragon, ruling over both the Catalans and the Aragonese.

Creation
The reconquista from the Moors by the Franks began in 785. In 785, Rostany (or Rostaing) was made Count of Girona, the first, of what would later become the Catalan counties, to be established. Besalú and Empúries were originally part of Girona. When Urgell and Cerdanya were conquered by Carolingian forces around 798, they were also made counties of the Hispanic March and Borrell was made count. He took a very active part in the subsequent conquest of Osona in 799 and the successful siege of Barcelona in 801. He was made count of Osona in 799, perhaps as a reward for his services. In 801, in the greatest military triumph of his long career, Louis the Pious, son of Charlamagne, took Barcelona from its Muslim rulers, making it the greatest city of the Hispanic March's littoral. The county of Barcelona was established and Bera was made its count. In 812, Count dilo of Girona (which included Besalú and Empúries) died and the county also passed to Bera.

In 804 and 805, Borrell participated in the expeditions to Tortosa, but not in the subsequent campaigns of 808 and 809. On Borrell's death in 820, Osona was given to Rampon and Urgell and Cerdanya went to Aznar Galíndez. Also in 820, Bera went into political disfavour and lost the countships of Barcelona and Girona, which also went to Rampon.

Around 813, Empúries became a separate county under Ermenguer, and in 817, it was united to the County of Roussillon. From 835 to 844, Sunyer I was count of Empúries and Peralada while Alaric I was count of Roussillon and Vallespir.

Besalú was made a separate county in 878 for Radulf on the condition that it pass to the heirs of Wilfred the Hairy on his death. It went to Miro I the Younger in 912.

Barcelona soon overshadowed the other counties in importance, especially during the reign of Wilfred the Hairy in the late 9th century. At that time, the power of the Carolingian Empire was waning and the neglected Hispanic March counties were practically independent of its royal authority. In the early 11th century, Berenguer Ramon I, Count of Barcelona, was able to submit to Sancho III of Navarre as his suzerain, even though he was still legally a vassal of Robert II of France. With the accession of Robert's father, Hugh Capet, the first non-Carolingian king, in 987, most of the counts refused to pay homage to the new dynasty. Over the next century, most of the counties were absorbed or became vassals of the County of Barcelona. In 1137, the Count of Barcelona Ramon Berenguer IV married the heiress of the Kingdom of Aragon, Petronella, uniting the County of Barcelona and its vassals with the Kingdom of Aragon to create the Crown of Aragon. Several of the later Aragonese kings re-created some of the counties as appanages for younger sons.

Catalan Counties under House of Pallars
(Note: According to some authors, the county of Pallars (and by extension Ribagorça) aren't exactly part of the Catalan group of counties )

House of Trastámara (1412-1516) and the Catalan Civil War (1462-1472)
Martin died without legitimate descendants (interregnum 31 May 1410 – 24 June 1412). By the Compromise of Caspe of 1412 the County of Barcelona and the rest of the dominions of the Crown of Aragon passed to a branch of the House of Trastamara.

House of Bourbon (Spanish branch) 1714-1808
In 1714, Catalan lost their war (within the Spanish war of Succession conflict) against the remaining sole pretender to the Crown of Spain: Philip of Anjou. Through the Nueva Planta decrees, the new king Philip V abolished the Catalan Constitutions and dissolved the Crown of Aragon. The Principality of Catalonia became another province of the Crown of Castille, and thus the title of Count of Barcelona was emptied of real political significance and power. Since then, the numbering of the Counts of Barcelona follows that of the Crown of Castille. That is the reason why Philip of Anjou was called by the Catalan Authorities 'Felip IV' in 1702 but called himself 'Felipe V' when he sized the title of Count of Barcelona in 1714, after winning the war against the Catalans.

House of Bonaparte 1808-1813
In 1808 Charles IV and his son Ferdinand resign from their Crown of Spain titles and transfer them to Emperor Napoleon, who kept for himself the title of Count of Barcelona. By 1812, once he had full military control over the Principality of Catalonia, he separated it from the Crown of Spain and annexed it to the French Empire.

House of Bourbon (Reannexation to Spain) 1813-1931; 1975-present day
After the Napoleonic Wars, Barcelona returned to Spanish domain. During the 2nd Spanish Republic and Francoist Dictatorship the Bourbons remained in exile and retained their dynastic titles, including 'Count of Barcelona'. Although on 26 July 1947, Spain was declared a kingdom, no monarch was designated until 1969, when Franco established Juan Carlos of Bourbon as his official heir-apparent. With the death of Franco on 20 November 1975, Juan Carlos became the King of Spain.