 However, the line of the counts died out in 1117 and the county was inherited by the counts of Barcelona, later to become kings of Aragon.Cerdanya proper was split between Spain and France by the Treaty of the Pyrenees of 1659, with the north of Cerdanya becoming French, while the south of Cerdanya remained Spanish.The counties of Rosselló, Capcir and Conflent also became French at that time.