It is famous for having been the prison and execution place of Beatrice di Tenda (Duchess of Milan and wife of Filippo Maria Visconti), who was arrested and sentenced to death for adultery in 1418.
Luchino Visconti, Lord of Milan, built the castle, probably between 1315 and 1319, when the nearby church of Saint Stephan was erected.
Its first mention dates back to 1329 when Azzone Visconti and his uncle Giovanni used it as a prison for their political opponents.
[1] The building followed the Visconti castle model of the Lombard plains: a quadrangular layout with a central courtyard, corner towers, and the surrounding moat.
The current building results from repeated restorations that preserved the appearance of the initial castle.