The Order settles in Spain at the beginning of the 12th century, arriving in Andalusia with the campaigns of Fernando III. He concentrated most of his patrimony in lands of Córdoba and Seville and in the Guadalquivir’s middle course.
Lora’s donation to the Order of Saint John of Jerusalem was the result of the reconquering work of Fernando III. In a privileged shot of 1241, Lora’s villas and castles, Setefilla and Almenara Castle were given away. In 1249, the “sanjuanistas” received the Malapiel’s and Alcolea’s forts as a donation. They also obtained a diploma eight years later, in which both the previous fortresses and the forts of Peñaflor and Algarín were added. Setefilla’ bailiwick began to be built with these donations.