It seems to have originated between the 10th and 11th centuries in response to the need of the Caliphate of Córdoba, established by Adderramán III, to guarantee the control and defence of the passes and roads in the face of the threat posed by the various Andalusian taifas and coras, as well as the Christian resistance.
It was part of a network of small fortresses strategically located on rocky outcrops and easily defended heights, known as Hisn. In Arabic sources it appears as Hisn al-'Iqab (castle of the slopes) or Hisn al-Uqab (of the eagle), depending on the translation. The first Christian reference to the name of the Castle of Toulouse is due to the Archbishop of Narbonne, Arnold Amalaric, who, having taken part in the Crusade, sent his account to the Cistercian Chapter in August 1212. Curiously, it gave its name to the epic battle between the Almohad army of Al Nasir and the Christian crusaders commanded by Alfonso VIII, becoming immortalised in history.