Occupied during the War of Spanish Succession, the castle suffered a huge blow when the powder magazine, destroying one of the towers, following the withdrawal of the Spanish forces under the Duke of Ossuna command (1707).