Archaeological finds unearthed in the Badajoz area have been dated to the Bronze Age. Megalithic tombs are dated as far back as 4000 BC, while many of the steles found are from the Late Bronze Age. Other finds include weapons such as axes and swords, everyday items of pottery and utensils, and various items of jewellery such as bracelets. Archaeological excavations have revealed remnants from the Lower Paleolithic period. Artifacts have also been found at the Roman town of Colonia Civitas Pacensis in the Badajoz area, although a significant number of larger artifacts were found in Mérida.

With the invasion of the Romans, which started in 218 BC during the Second Punic War, Badajoz and Extremadura became part of the administrative district called Hispania Ulterior (Farther Spain), which was later divided by Emperor Augustus into Hispania Ulterior Baetica and Hispania Ulterior Lusitania; Badajoz became part of Lusitania. Though the settlement is not mentioned in Roman history, Roman villas such as the La Cocosa Villa have been discovered in the area, while Visigothic constructions have also been found in the vicinity.

Badajoz attained importance during the reign of Moorish rulers such as the Umayyad caliphs of Córdoba, and the Almoravids and Almohads of North Africa. From the 8th century, the Umayyad dynasty controlled the region until the early 11th century. The official foundation of Badajoz was laid by the Muladi nobleman Ibn Marwan, around 875, after he had been expelled from Mérida. Under Ibn Marwan, the city was the seat of an effective autonomous rebel state which was quenched only in the 10th century. In 1021 (or possibly 1031 ), it became the capital of a small Muslim kingdom, the Taifa of Badajoz; with some 25,000 inhabitants. Badajoz was known as Baṭalyaws (Arabic: بَطَلْيَوْس‎) during Muslim rule. The invasion of Badajoz by Christian rulers in 1086 under Alfonso VI of Castile, overturned the rule of the Moors. In addition to an invasion by the Almoravids of Morocco in 1067, Badajoz was later invaded by the Almohads in 1147.