The castle, whose foundations date back to the early tenth century, was a strong fortress that withstood the repeated attacks of Simon de Montfort IV between 1211 and 1217, during the Albigensian Crusade. In 1272, when the Count of Foix refused to recognize the sovereignty of the king of France, Philip the Bold personally took the leadership of an expedition against the city, subsequently the count surrendered. In 1290, at a meeting of the Béarn region and the county of Foix, the city was practically abandoned by the Counts. Gaston Phoebus was the last to have lived in the castle, and by the sixteenth century the castle had lost its military purpose. The castle was then used as a prison until 1864.