Recent archaeological findings indicate a pre-Roman settlement at Úbeda. Romansand later Visigoths occupied the site as a settlement. This area became an important city in the Muslim conquest of the Iberia. It was refounded by Abd ar-Rahman II (822–852), who called it أُبَّدَة الْعَرَب (Ubbadat-Al-Arab). It was included in the area of Jaén. In this period, its territory extended to more than 35,000 hectares.
During the Reconquista, in 1233, king Ferdinand III was able to wrest the town from the Muslim rulers. After that, the Muslim, Christian and Jewish cultures coexisted for a long time.
In the Christian period the territory of Úbeda increased substantially, including the area from Torres de Acún (Granada) to Santisteban del Puerto, passing by cities likeAlbánchez de Úbeda, Huesa and Canena, and, in the middle of the 16th century it also included Cabra del Santo Cristo, Quesada or Torreperogil.
During the 14th and the 15th centuries, internecine fighting among local nobility and populace impaired the growth of the town. In 1368 the city was devastated because of the civil war between Peter I of Castile and Henry II of Castile. This, combined with other circumstances, caused the worsening of the rivalry between the families de Trapera and de Aranda in the first moment, and the families de la Cueva and de Molina after. This produced many problems and fights which were solved when the Catholic Monarchs intervened: they ordered the Alcázar, used by the nobility as a fortress, to be destroyed.
Úbeda, on the border between Granada and Castile-La Mancha, was an important geographic buffer, and thus the population gained from the Castilian kings, a number of official privileges, such as the "Fuero de Cuenca", which tried to organize the population formed by people from Castilla and from León, in order to face the problems that there could be in the border. With the "Fuero de Cuenca", a popular Council was formed,