 In the 9th century Cerdanya was one of the lordships united in the person of the counts of Barcelona, who were also counts of Girona, Narbonne and Urgell.Wilfred the Hairy (count 870–897) had three sons and established the youngest, Miron (died 927), as Count of Cerdanya, a sovereign state.The sovereign county of Cerdanya bordered the county of Urgell, the county of Barcelona, the county of Besalú, the county of Roussillon, and the county of Razès.