when the treaty of corbeil is signed in 1258, the border between france and spain is right to the south of the castle. in the year 1240, after the albigensian crusade against the cathars, the castle becomes french. it is extended, and there is a garrison placed there; it protects against invasions until the 16th century when roussillon becomes a french territory.