The vividness of the scenery increases on arriving in the valleys and foothills of the Sierras Subbéticas. From Cabra onwards, the road starts climbing and crosses some hilly passes until a fertile plain is reached below Priego, encircled by mountains. As in other instances, people of all the ages appear to have agreed that it was a good place in which to settle, corroborated by the pre-historical –as well as Iberian and Roman remains found in the area.
Towards the year 863, Baguh, the Hispano-Arabic name for Priego, is mentioned as the place in the hills which contributed troops to one of the military campaigns of the emir Muhammad I. In this reference, the cora (province) of Priego plays an active role in the struggles and revolts of the end of the 9th century. In 889, it became the headquarters of Ibn Mastana, self-appointed lord of Priego and Luque, one of the principal leaders of Ibn Hafsun’s Muwallad rebellion. After different conquests and destructions, he took profit of the prosperity achieved by the Caliphate. When the Caliphate fell, it passed into the hands of the Zirids of Granada, then of the Almoravids and later still of the Almohads.
Though the town’s defences were strengthened, king Ferdinand III took Baguh in 1225 in the course of his campaigns in the upper valley of the Guadalquivir. Owing to its geographical position as an advance post, it was given to the order of Calatrava. However, it was to change hands once more in 1327, when it was taken by the Nasrids in the Knight Commander’s absence. In 1340 the fort was definitely taken by king Alfonso XI, who repaired the walls and repopulated the town.
Since 1370, Priego has been part of the domains of the Aguilar family, when Gonzalo Fernández de Córdoba became its overlord; the latter’s descendent Pedro later became the first Marquis of Priego in 1502. A period of prosperity began, during which many public, private and religious buildings were put up. The 18th century brought an interval of particular affluence, thanks to the remarkable expansion of textile industry, which enabled the town to acquire countless Baroque works of art.