 Olivier, however, eventually made an alliance with king Louis IX, who purchased the castle from him in 1260.Despite the heavy fortifications, the castle would be continually under siege by opposers to the French or Spanish rulers until the 16th century.When the border was pushed back to the south of Roussillon by the treaty of the Pyrenées, the castle gradually lost its strategic importance, and was eventually abandoned in 1569.