During the struggle with neighboring cities, the castle was destroyed in 1242 by the troops of Frederick II. They had a difficult history until 1799 when the town was destroyed and looted by the Napoleonic army.