The town stands at a high elevation about 3 miles (4.8 km) from the right bank of the Guadalquivir in the
Loma de Úbeda. Under the Romans, the town was known as Beatia. Following its conquest by the Visigoths, Beatia was the seat of a bishopric of Baeza (viz.), which was suppressed after a period under Moorish rule.
Baeza reached its greatest prosperity under Islamic rule, when it formed the capital of an effectively independent
?emirate and reached a population of around 50,000. Remnants of the Moors' fortifications include the town's Jaén and Úbeda gates and the Arch of Baeza.
The Christian diocese was reëstablished in 1127 or 1147Alfonso VII of Castile, but it was then reconquered by the Muslims and its cathedral adopted as a mosque. The town never recovered from the destruction endured upon its conquest by Ferdinand III of Castile in 1227 or 1239. The diocese of Baeza was merged with Jaén in 1248 or 1249, but was later nominally restored as a titular see of the Roman Catholic Church.
following the town's conquest by
The red dye made from a local cochineal came to be celebrated and a second era of lesser prosperity occurred in the 16th century, when Baeza and nearby Úbeda grew rich from their textile industry. Local nobles hired major architects of the era (including Andrés de Vandelvira) to design the present cathedral, churches, public buildings, and private palaces in the then-fashionable Italian style. The town's university building dates to 1533. The economy collapsed in the 17th century, with the only remaining industry consisting of local production of grain and olive oil. As few newer structures were built during this period, this had the effect of preserving the town's Renaissance legacy. The university closed for a time before being reopened by the 19th century as a seminary. In the 1870s, the population was around 11,000; over the next few decades, the Linares–Almeria railway was constructed nearby and town's population grew to 14,000 by 1900.