The castle was built around 1450-1470 on former medieval buildings. The original medieval structure and its walls were commissioned by the italian condottiero Giacomo Caldora to protect the town against the Aragons who eventually managed to conquer the city. LAter, Alfonso of Aragon decided to commission a new project of the Castle in order to protect the harbor which used to be the economic heart of the town.