County of Barcelona

The County of Barcelona (, ) was originally a frontier region under the rule of the Carolingian dynasty. In the 10th century, the Counts of Barcelona became progressively independent, hereditary rulers in constant warfare with the Islamic Caliphate of Córdoba and its successor states. The counts, through marriage, alliances and treaties, acquired the other Catalan counties and extended their influence along Occitania. In 1164, the County of Barcelona entered a personal union with the Kingdom of Aragon. Thenceforward, the history of the county is subsumed within that of the Crown of Aragon, but the city of Barcelona remained preeminent within it. Within the Crown, the County of Barcelona and the other Catalan counties developed a common polity known as the Principality of Catalonia.
Origins.
Its origins date back to the early 8th century, when Muslims took control of the northern territories of the Visigothic Kingdom in Hispania and modern-day northeastern Spain and southern France. After turning back deep Muslim incursions, the Frankish Empire under the Carolingian monarchs, created the Marches of Gothia and Hispania progressively. This was achieved by taking over the territories of Septimania that the Moors invaded in the 8th century and from these, those territories surrounding the Pyrenees and specially the northeast of the Iberian Peninsula. These eastern Iberian territories were repopulated with people from the March of Gothia.
This resulted in the formation of an effective buffer zone between the Muslim Iberian peninsula and the Duchy of Aquitaine and Provence.
Frankish rule.
The area was dominated by the Franks after the conquest of Girona (785) and especially when, in 801, the city of Barcelona was conquered by King Louis the Pious of Aquitaine, and was incorporated into the Frankish kingdom. The county of Barcelona was established there, reporting to the Frankish king. The first count of Barcelona was Bera (801–820).
Initially, authority for the county rested on the local aristocracy. However, the policies Bera adopted in an effort to maintain peace with Muslim ruled Al-Andalus, resulted in him being accused of treason before the king. After losing a duel, according to the Visigothic legislation, Bera was deposed and exiled, and the government of the county went to Frankish nobles, such as Rampon or Bernard of Septimania. However, the Visigothic nobility regained the king's confidence with the appointment of Sunifred I of Urgell-Cerdanya as count of Barcelona in 844.
Autonomy and unification.
Nevertheless, the ties of the Catalan counties to the Frankish monarchy had weakened. Autonomy was strengthened when the county families began to affirm their inheritance rights. This move was accompanied by a unification process among counties to form larger political entities. Count Wilfred the Hairy, son of Sunifred and the last count appointed by the Frankish king, oversaw this movement. He united a number of counties under his command and passed them on as an inheritance to his children. Wilfred later died at the hands of Muslims. Although he divided his counties among his children, the core formed by the counties of Barcelona, Girona and Osona remained undivided (although some historians, such as Ramon Martí, question whether Girona was kept initially under the domain of the children of Wilfred, and suggests that the County of Empúries dominated the county until the year of 908).
Independence.
During the 10th century, the counts of Barcelona strengthened their political authority and further distanced themselves from Frankish influence. In 985 Barcelona, then ruled by Borrell II, was attacked and burned by Muslims, led by Almanzor. The count took refuge in the Montserrat mountains, awaiting help from the Frankish king, which never arrived, resulting in resentment. In 988, the reign of the Carolingian dynasty ended and was replaced by the Capetian dynasty. Borrell II was required to swear allegiance to the new Frankish king, but there is no evidence that the count acceded to the call, as the Frankish king had to go north to resolve a conflict. This has been interpreted as the starting point of effective independence of the county. The relinquishment of any possible French claim of feudal overlordship was obtained by James I in the Treaty of Corbeil (1258).
Subsequently, the County of Barcelona grew in importance and expanded its territory with successive counts. It took over other Hispanic counties and expanded slowly towards the south as a result of battles against al-Andalus and the repopulation of areas such as Tarragona and the surrounding countryside.
Borrell II's reign was followed by that of his great-grandson Ramon Berenguer I. His grandmother was the forceful Ermesinde of Carcassonne. During the regency of Ermessinde (1018-1044) the disintegration of central power due to Feudal revolution was evident. Ramon Berenguer I reinforced the county's power by subjecting the rebellious Penedès nobles led by Mir Geribert, partnering with the counts of Urgell and Pallars, acquiring the counties of Carcassonne and Rasez, charging pariahs from the Zaragoza and Lleida kingdoms, and renewing the legislative framework of the county to allow for the introduction of the Usages of Barcelona. These were a set of feudal rules and customs that would increase in subsequent years, and they will be the basis of the Catalan constitutions from the 12th century onwards. In his will he decided not to divide the territories again, but he transferred unified rule to his twin sons, Ramon Berenguer II and Berenguer Ramon II.
After a crisis provoked by the murder of Ramon Berenguer II and accusations of fratricide against his brother, who died in the First Crusade, his son and heir, Ramon Berenguer III, was able to consolidate and expand the boundaries of the county. He conquered part of the County of Empúries and, leading a wide coalition, also attempted to conquer Mallorca, but had to abandon it because of the advance of the Almoravids troops on the peninsula. He also received, by inheritance, the Besalú and Cerdanya counties, gradually forming a territory very similar to what was once Old Catalonia. He also moved towards Lleida and repopulated border areas such as the city of Tarragona, effectively restoring it as the episcopal see. He also extended his trans-Pyrenean reign by incorporating Provence county through his marriage to Countess Dolça in 1112.
Birth of the Crown of Aragon.
However another marriage, that of Ramon Berenguer IV of Barcelona and Petronilla of Aragon in 1137, resulted in a union of dynasties –the counts of Barcelona and the royal house of Aragon. Ramon Berenguer IV was, until his death, Count of Barcelona and Prince of Aragon. Their son, Alfonso II, was the first king of Aragon who, in turn was the Count of Barcelona, titles all the kings of the Crown of Aragon inherited from then on. Each territory that formed the union would maintain their traditions, laws, customs, currency and, in time, would develop separate state government institutions. From that point, along the next two centuries, the territory and institutional structure of the County of Barcelona became the basis of a new polity within the Crown of Aragon derived from the geographical context (Catalonia) and the traditional expression of the power of the counts (principality), the Principality of Catalonia. However, the title of count of Barcelona remained intact.
During the 13th and 14th centuries, the county would still be ruled by the Kings of Aragon, but the death of Martí l'humà without descendants in 1410 ended the House of Barcelona and, as a result of the Caspe Compromise, county's ownership passed to the Trastámara dynasty, native of Castile, in the person of Ferdinand I. Later, when his grandson Ferdinand II of Aragon married Isabella of Castile and was crowned king, the dynastic union between the crowns of Castile and Aragon would involve the progressive inclusion of the county as one of the different Iberian territories ruled by the Habsburgs.
Abandonment of Countship.
Despite the uniting of the county to the Spanish monarchy, the Barcelona County law itself remained in force until it was abolished in 1716 with the Nueva Planta Decrees after the Spanish War of Succession. Since then the county stopped being a political entity and the policy arena of the current Catalonia would only be defined as such by the Statutes of Autonomy of 1932, 1979 and 2006. Moreover, the title of Count of Barcelona is now merged with the Spanish crown. Juan Carlos I granted it to his father Juan de Borbón, reverting, on his death, to the titles of the Spanish Crown as a royal title.