San Pedro de Mérida is a municipality located in the province of Badajoz, Extremadura. Its origins date back to the Visigothic period, and after the Reconquista of the area, it was controlled by the Order of Santiago.
According to tradition, the Visigothic basilica that gave rise to the municipality is the place where King Don Rodrigo took refuge after the Battle of Guadalete in the year 711.
Following the fall of the Old Regime in the 19th century, it became a constitutional municipality.