In the 10th century, the Counts of Barcelona progressively achieved independence from Frankish rule, becoming hereditary rulers in constant warfare with the Islamic Caliphate of Córdoba and its successor states.
The counts, through marriage, alliances and treaties, acquired or vassalized the other Catalan counties and extended their influence over Occitania.
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 hystoriographycally Marches of Gothia and Hispania progressively.
[1] 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.
However, the policies Bera adopted in an effort to maintain peace with Muslim ruled Al-Andalus,[3] 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,[4] such as Rampon or Bernard of Septimania.
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.
[7] 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 13th century onwards.
[8] Each territory that formed the union would maintain their respective 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 (such as the Courts) 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) which, from the Peace and Truce of 1173, was extended from Salses to Lleida and Tortosa.