H uman occupation in the current municipal area of Baena must date back to the Paleolithic. But it will be during the Metal Age when the lands were clearly occupied by communities that based their way of life on cereal agriculture and livestock, also emerging the practice of metallurgy.
With the arrival of the colonial influences from the eastern Mediterranean (Phoenicians and Greeks), around the VIII-VII centuries b.c, the settlement increases notably, emerging large inhabited nucleous that are surrounded by strong walls, such as Torreparedones. These cities, governed by elites of aristocratic rank, reached a high degree of development during the Iberian period, which is reflected in the construction of notable monuments (most of them funerary in nature) decorated with animal sculptures.
During Roman times the term of Baena was intensely habited. Most of the sites cataloged to date abstain at this time, and it should also be noted that several of them reached the rank of municipality or colony.
The archaeological activities in the urban area of Baena, specifically in the church of Santa María La Mayor, in the area of the Plaza Palacio and in the castle, have uncovered material remains prior to the low-medieval period, although written sources indicate that the place was occupied after the Islamic invasion of the Iberian Peninsula.
Baena is a living testimony of its own history. The place name of Baena comes from the Arabic Bayyana, which, in turn, is the transcription of the name of one of the many Roman villas that would survive until the Visigothic period and that in the 7th century the Arab-Berber invaders chose as a place of settlement, fortifying it.
First news about the Muslim Baena dates back to the 9th century on the occasion of the Muladi rebellion led by Umar ben Hafsún, who seized the place in 899. Shortly after, around 929, it became the capital of the heart of Goat. There are hardly any emerging remains of the Muslim castle, what is currently preserved dates from the 14th century. There are important sections of the wall with some towers and gates of the Almedina enclosure (Arco Oscuro, Arco de la Consolación).
At the fall of the caliphate it was brutally sacked by the Berbers fleeing to the South, thus interrupting its growing prosperity. By pact, the Muslims surrendered to Fernando III in 1241.
His border situation caused multiple conflicts. Thus, in 1300, Muhammad II besieged the Villa and won half of it; the resistance of the Christians prevented its conquest and the Muslims were expelled. This situation was repeated in the year 1330, reigning the same king, without the town being taken either.
The first attempt to subject the town to Christian rule was in 1369. This favor was granted by King Enrique II to Diego García de Toledo, but the rejection of the people caused this order to be without effect. In 1386, already with D. Juan I in the Crown, this favor was granted to D. Diego Fernández de Córdoba who had to impose himself before the insubordination of the people in 1394. It would not be, however, until 1401 when Fernández de Córdoba obtained the concession definitive of the dominion, on the part of Enrique III.
The lords of Baena, received the title of Dukes of Sessa in the first quarter of the 16th century, in 1520, on the occasion of the marriage between Luis Fernández de Cordoba, Count of Cabra and Lord of Baena, and Elvira Fernández de Córdoba, Duchess of Sessa, carrying out a patronage of the town that led to the construction of the most important monuments.