At the end of the 9th century, the Carolingian monarch Charles the Bald designated Wilfred the Hairy — a noble descendant of a family from Conflent and son of the earlier Count of Barcelona Sunifred I — as Count of Cerdanya and Urgell (870). After Charles's death (877), Wilfred became the Count of Barcelona and Girona (878) as well, bringing together the greater part of what was later to become Catalonia. On his death the counties were divided again among his sons, however, since then, the counties of Barcelona, Girona and Ausona (he repopulated the last one after a revolt) remained under the rule of the same person, becoming the core of the future Principality. Upon his death in 897 Wilfred, making their titles hereditaries founded the dynasty of the House of Barcelona, which ruled Catalonia until the death of Martin I, its last ruling member, in 1410.