 Due to its strategic position, the castle was contested first by Emperor Frederick Barbarossa and Milan, in the 12th century, and later by the Visconti and the Torriani families.The castle was destroyed or burnt several times, but was rebuilt on each occasion.The last reconstruction dates from 1370.