County of Urgell

The County of Urgell (, ; ) is one of the historical Catalan counties, bordering on the counties of Pallars and Cerdanya.
History.
The county of Urgell was carved by the Franks out of a former section of the Mark of Toulouse when the Alt Urgell area became part of the Carolingian Empire between 785 and 790.
The original territory was made up of the Alt Urgell, also known as Urgellet from the end of the 12th century onwards, with the see at La Seu d'Urgell. From 839 onwards it would include 129 villages, the valleys of the Valira river, namely Andorra and Sant Joan Fumat, the Segre riverine area as well as the valleys located between El Pont de Bar and Oliana.
Its maximal extension territory was between the Pyrenees and the taifa of Lleida, that is, the current comarques of Alt Urgell or Urgellet, Noguera, Solsonès, Pla d'Urgell, Baix Urgell and the still independent country of Andorra. The historical capital was first la Seu d'Urgell and later Balaguer. The county of Urgell was extinguished and absorbed by the Crown of Aragon in 1413 as a part of the Principality of Catalonia, after the revolt of the last count, James II of Urgell, against the king Ferdinand I of Aragon.
First dynasty.
Sunifred II of Urgell (897-948) died without descendants and the county went to his nephew Borrell II, Count of Barcelona, Girona and Osona. In his testament Borrell II, who died in 992, gave Barcelona, Girona and Osona to Ramon Borrell (992-1017), while Urgell went to Ermengol I (992-1010), so that the Count of Urgell title became separated from the House of Barcelona. Thus the first dynasty of Urgell began with Ermengol I. The first dynasty is also known as Barcelona-Urgell.
The title was disputed by Peter I and Guerau IV de Cabrera during Aurembiaix's time.
Second dynasty.
In 1231 Countess Aurembiaix died without descendants and the first dynasty became extinguished. After a period of dynastic squabbles Jaume I acknowledged Ponç IV of Cabrera as the successor to the County of Urgell. The second dynasty is also known as Cabrera-Urgell.
Third dynasty.
Ermengol X d'Urgell named his niece Teresa d'Entença as successor to the county. She was married to Alfons el Benigne, son of James II of Aragon. The third and last dynasty is also known as Aragon-Urgell.
Diocese of Urgell.
There is also a Roman Catholic diocese of Urgell. The diocese is of ancient origin and traditions of the early Christian church lingered. Felix of Urgel's tendencies towards the heretical position of adoptionism was attacked by Alcuin of York in "Contra Felicem".
Andorra was ceded to the bishop of Urgell by the count Ermengol VI of Urgell in the twelfth century. The bishop of Urgell, who since 2003 has been Joan Enric Vives Sicília, is simultaneously joint head of state of Andorra alongside the President of the French Republic.