In the Ordinatio Imperii of 817, Louis the Pious made it a part of Aquitaine and ruled it directly along with the other maritime counties of the Marca: Roussillon, Girona, Barcelona, and Empúries. Besalú, along with Barcelona and Girona were placed under Count Bera, a Visigoth. Under Louis the Pious Gothia saw a reinvigorated monasticism spread first in Pallars and then eastward into Roussillon, Empúries, and Besalú. Under Louis and his successors, a system of aprisiones was established in Besalú, largely held by native Goths and immigrant Gascons.
During the reign of Charles the Bald Besalú was attached to the counties of Urgel and Cerdagne. In 871, Wilfred the Hairy and his kin began the encastellation of Besalú by constructing a forward castle at Castellaris. Wilfred later separated it and made his brother Radulf its count and it became one of the last de facto independent Catalan counties.
The brothers, and their younger brothers Oliba Cabreta and Miro Bonfill, acted consonantly throughout their lives. In 943 Sunyer of Barcelona attacked Besalú and Ripoll and Sunifred came to Wilfred's aid. The brother also retained their ties to the French crown, though they often carried the title marchio, probably without royal sanction but perhaps as a hangover from Carolingian times. Oliba received royal lands and rights in Besalú from Rudolph in 929, indicating the presence and memory of the royal fisc in Besalú. Wilfred even going to the court of Louis IV in order to solicit a privilege of immunity to the monastery of Sant Pere de Camprodon which he and his brother had jointly founded as their legacy. Wilfred also received a portion of the property which the viscount Unifred had treacherously taken from Ermengol of Osona by a precept of Louis's.
In the latter half of the tenth century, the power and authority of the counts of Besalú and Cerdagne increased. In 957, Besalú was rocked by the rebellion of a faction of the noblesse backing the sons of the deceased count Radulf. Wilfred was assassinated and Sunifred annexed the property of the rebels and took over the county. In 965, Sunifred passed all his counties on to Oliba, who gave Besalú as a subordinate countship to Miro, but when Miro became Bishop of Girona in 971, Besalú was reattached to Cerdagne.
In 988, Oliba entered Montecassino and left Besalú — along with Vallespir, Fenouillèdes, and Peyrepertuse — to Bernard Tallaferro. He annexed Ripoll in 1002. He inaugurated an independent line of rulers in Besalú and thus diminished the power of his dynasty. Pope Benedict VIII established diocese in Besalú for Bernard's benefit, but it was short-lived.
The last quarter of the tenth century and first quarter of the eleventh witnessed very little war in southern France and Catalonia, some of the only instances occurring between Oliba Cabreta and the Counts of Carcassonne. In this period as well, Carolingian courts and Gothic law were still in effect in Besalú, as late as 1031. Between 969 and 1020, the county of Besalú minted its own money, though this currency has not been preserved in the form of coins, its only evidence being documentary. Between 1020 and 1111, three different kinds of silver coin were minted in Besalú. The engravings of Besalú in the eleventh century have been considered some of the best exemplars of the Romanesque style.
In 1066, William II died and Besalú was co-ruled by his brother, Bernard II and his son, Bernard III. In 1100, the moderate and stable Bernard II died and Bernard III began to reign on his own. He had little support from the local nobility and Raymond Berengar III of Barcelona took the opportunity to augment his influence in the region.
At the turn of the twelfth century, Besalú extended as across the Pyrenees as far as Corbières. It dominated and patronised the monasteries of Sant Joan de las Abadesses, Saint-Michel-de-Cuxa, and Lagrasse. It encompassed the castles of Tautavel, Vingrau, Queribus, Aguilar, and Peyrepertuse, which were refortified in the thirteenth century by Louis IX of France as forming his southern border with the Crown of Aragon by the Treaty of Corbeil (1259). The rest of Besalú was a part of the Principality of Catalonia within the Crown.
In 1107, Bernard III married Jimena, Raymond Berengar's daughter. In the marriage pact, Raymond Berengar ceded Osona and the Diocese of Vic with all their castles. In return, Barcelona became the heir of Bernard if he died without children. At the time Bernard was fifty years of age (older than his father-in-law) and Jimena a mere child of seven or eight. It was not unlikely that Bernard would die before the marriage could legally be consummated. The aging and ineffectual Count of Besalú showed no desire to govern and readily allowed his new father-in-law to fill the vacuum left by the death of Bernard II.
In 1111, Bernard died and Barcelona inherited Besalú. This led to conflict with Bernard William of Cerdagne, who was the feudal suzerain of Besalú. The problem was solved by the cession of Vallespir, Fenolledès, Peyrepertuse, and Castellnou to Cerdagne for compensation.
On Bernard's death in 1020, the bishops of Girona and Vic reclaimed their ancient rights over the parishes of Besalú. Wilfred, lacking a political protector, retired to his monastery and the diocese of Besalú was abolished.