Between the 13th and 14th centuries, Calp was walled to protect it from Muslim attacks. Its coastal location meant that the population suffered continuous attacks from pirates, so in the 16th century Charles V ordered that these walls be repaired.
The residents accessed the citadel through a single portal called "El Portalet". The hardest of the attacks took place in 1637. The Barbary pirates invaded the town without being seen. During that attack they took practically all the Calpines captive.
Another of the most important attacks that the town suffered, and which gave rise to its patron saint festivities, was the one that occurred on October 22, 1744. After this pirate assault, a project was started to fortify the town. and a second wall was built, that surrounds the suburb and the old citadel. The "Torreó de la Peça" owes its name to a fort demolished in the 20th century which in its day had an artillery piece.