It had an enduring effect in the Treaty of the Pyrenees ( 1659 ) , which ceded the County of Roussillon and the northern half of the County of Cerdanya to France ( see French Cerdagne ) , splitting these northern Catalan territories off from the Principality of Catalonia and the Crown of Aragon , and thereby receding the borders of Spain to the Pyrenees .