The origins of the town are remote, and there are authors who identify as compared to the Carthaginian rule. In the Archaeological Museum of Albacete are still two ceramic vessels dating from the Bronze Age found in Pe as de San Pedro. It seems that in Roman times was known as Castrum Altum. Even before the Muslim occupation (which took place around 928-929) should have a name similar to the present, appearing as cited in San Bitru Arabic texts or Sanfiro. In the Latin texts of the thirteenth century is cited as Rupe Sancti Petri, probably referring to the name before the Conquest. Almost until the early nineteenth century history of Pe as subscriptions de San Pedro has been in relation to his castle-fortress, whose peak was located in the town until calmer times allowed to fall to its present location.The castle is an impressive rocky plateau that rises vertically nearly one hundred meters from its base, and nearly two hundred on the plain, accessible only by payment a walled road located on its southern side. The whole complex is walled and inside the enclosure are the ruins of ancient buildings. During the Reconquista the castle became important at these latitudes approaching the border. By 1216-1217 it was briefly occupied by Castilian order troops, but about a year after Capt. border Hud ibn Muhammad ibn Yusuf al-Yudami (which later became the first king of Murcia), in front of 500 men taken by surprise the castle at night by climbing the steep rock and the wall, killing the guard Castilian and forcing the defenders to surrender after setting fire to the door of the tower where they had sought refuge.Years later came the definitive Christian occupation, which had to take place somewhat earlier date for the conquest of the Kingdom of Murcia, being integrated magazine subscriptions within the administrative district of Al, although belonging to the Diocese of Cartagena. In 1242 it surrendered the castle (and with it the magazine village) Mazuelo Sanchez Sancho, returning later to Alcaraz to change Tobarra village. In 1305 Al is required to have a new stocking of the Pe as de San Pedro, due to harsh living conditions at the top of the rock. From the time of the Castilian conquest, there were several attempts to achieve autonomy from Alcaraz, however, leaving the title of town until 1537, under the reign of Charles I. At that time, once the address danger of Muslim incursions, the people must have started to fall at the foot of the castle.Although in the eighteenth century neighbors still living high on the rock, that was church, virtually the entire population had dropped to the foot of the castle, built the City Hall, the Church of Our Lady of Hope, " pillar (public fountain that has its source below the castle) and many houses that still stand. Until 1833, establishing the present province of Albacete, the municipality of San Pedro Pe as was very extensive, covering about 625 square kilometers. At that time there was segregation of the existing municipalities Pozohondo, Alcadozo, San Pedro and Pozuelo. In 1836, during the 1st Carlist War, the castle was occupied by the troops of General Cabrera. At that time the town that was totally at the foot of the castle, built a small wall around the town for its defense, which still preserves some remains. Years later, as a result of the Confiscation, the castle passed into private hands.In the 1970s this town have a great business as a result of the construction in its underground tunnel of Talave, part of the Tajo-Segura Aqueduct. This important work led to improvements in public at that time the population and improve the economic situation of the town, although the purpose of the work produced a "rebound" with significant emigration in few years.
