The castle, which stands in the square of the same name, was built between 1358 and 1368, under Galeazzo II Visconti. In 1447 the government of the Ambrosian Republic decreed that it should be destroyed. Francesco Sforza ordered it to be rebuilt when he came to power. In 1521 the tower of Filarete blew up, causing an explosion of gunpowder. The castle suffered various adversities through the centuries. In 1880 the restoration work began under the direction of Luca Beltrami. The Filarete's Tower dominates the front of the castle. The lords of the castle normally resided in the Ducal Court, in a suite of richly frescoed and decorated halls.