The ancient name of the town, “Pietraperciata” (which means pierced stone), was given due to the presence of a hole in a large cliff, visible from the town. The exact date of the town’s construction is uncertain, with the most accredited theories suggesting its foundation by the Pelasgians in the 8th century BC as they traversed southern Italy. The Pelasgians built their homes in the lower part of the town to protect themselves from potential enemy attacks and erected fortifications on the rocks.
The Greeks, arriving from the Ionian coast, replaced the Pelasgians and moved inland, bringing their goods and artifacts. Evidence of Hellenic presence is reflected in Pietrapertosa’s amphitheater-like shape and in the names of certain places such as “La costa di Diana.” Subsequently, the Romans settled in the area, making Pietrapertosa their Oppidum by constructing a fortress, where the Church of San Francesco now stands.
During the barbarian invasions, it was occupied by the Goths and then by the Lombards, who included Pietrapertosa in the gastald of Acerenza. It later came under Byzantine rule by the Saracen lord Bomar. It was under Saracen dominion that Pietrapertosa saw the construction of its most characteristic parts. The Norman-Swabian descent saw the town become one of the most important strategic centers of Lucania due to its dominant position over the surrounding hill. It participated in the Ghibelline revolt against the Pope in 1268.
During the Angevin era, it became the fief of Guglielmo Tournespé in 1269, then passed to other feudal lords like Pietro de Burbura (1278) and Giovanni Borbone (1280). With the arrival of the Aragonese, Pietrapertosa became the possession of the Gozzuti, the Grappini, and the Diazcarlons, counts of Alife. In the 16th century, it passed to the Carafa, the Aprano, the Campolongo, the De Leonardis, the Suardi, the Iubero, and finally the Sifola of Trani.
In June 1647, the people of Pietrapertosa participated in the revolt against the taxes imposed by the local lords, a revolt that was harshly repressed: some of the rebels, especially the poorer ones, were forced to leave their town to escape punishment, being declared outlaws if they fled without paying the due tributes. The fugitives were thus forced to live as outlaws, surviving through plundering and theft. Many country monks who collaborated with the bandits also had to leave the town. Among these bandits was Scalandrone, a farmer from Pietrapertosa, who operated in the Basento valley.