The oldest structures in the castle of Sant Joan or Blanes date back to the 11th and 12th centuries, and were born at this time to have effective control of the territory and a place of protection against maritime incursions by pirates. It was attacked by King Philip the Ardite of France in 1285 and by Genoese troops in 1332, conflicts that caused much damage to both the fortress and the town, which is why major reforms were made during the second. half of the 14th century. Between the 16th and 18th centuries, the castle entered a period of decline and abandonment that lasted until the current restoration, which began in the middle of the 20th century.