Built on an older 7th-century fortification, the castle is known from written records in 987. In 1002 it was mentioned in the will of Roger I, Count of Carcassonne, who bequeathed it to his youngest child.
During the two following centuries, the castle was home to the Counts of Foix who were central to the Occitan resistance during the crusade against the Cathars. The county became a refuge for persecuted Cathars. The castle was often besieged (notably by Simon de Montfort in 1211 and 1212) but as one Count noted “The castle defends itself”.