The castle was built in 1277 for Ottone Visconti. Renovation began in 1381 under Filippo Maria Visconti and further embellishments were introduced under the Sforzas and Ludovico il Moro until it became a classic example of a lowlands castle. Surrounded by a moat, the castle is laid out around a central quadrangular courtyard, originally with four towers linked by two-storey constructions. The irregular courtyard still retains the gothic arcades that bounded it. All that remains of the four towers today is the one on the north-eastern side. In the centuries that followed, especially under Spanish rule, some parts of the complex were dismantled. The most interesting part of the building is the eastern side: ancient battlements, double lancet windows, a 13th century arcade and the Visconti symbol of the snake. Inside there are still traces of the ancient frescoes. The castle is currently undergoing careful restoration and is home to the Civic Library and some exhibition spaces.