The castle of Carcabuey has been throughout history a privileged place from the strategic and military point of view for the control of all the communication routes of the region of the Subbética, since in the confluían the roads that served of communication to Five Andalusian provinces.
It rises on a rocky promontory that dominates the town and to which it gives its name, the Hill of the Castle, in which rest and vestiges of human occupation have been found in all the historical periods, being able to go back in time until, at least , The Full Bronze as evidenced by the discovery of a bronze sword (1200 a C) currently preserved in the British Museum in London or a black cross ceramic pot (800 a C) that is in the Historical Museum of Priego de Córdoba.
In Islamic times it was the object of incursions by Ibn Hafsun, at the end of the Emirate, being dominated and demolished by the emir Add-Allah in 892. Conquistada the place by Fernando III, was rebuilt according to models of other fortifications, as those of Fuengirola or Iznajar. From the middle of the thirteenth century it belonged to the Order of Calatrava, until in 1333 it was conquered by Muhammad IV of Granada and reconquered and modified shortly after by Alfonso XI, integrating, after multiple donations in the Señorío de Aguilar.