Francesco Sforza, Duke of Milan, rebuilt it from 1450 on the ruins of a 14th-century Visconti castle, and today its courtyards house a group of Milan's civic museums and the city's art collections.
The first castle, the Castello di Porta Giova, was begun by Galeazzo II Visconti in 1358 and grew into a square fortress with sides 200 m long and walls up to 7 metres thick, before the Golden Ambrosian Republic destroyed it in 1447. Francesco Sforza turned the site into a princely residence, hiring the sculptor and architect Filarete in 1452 to design the central tower that still bears his name. Under Ludovico Sforza, from 1494, Leonardo da Vinci and Bramante painted rooms inside; around 1498 Leonardo decorated the ceiling of the Sala delle Asse with plant motifs. The Spanish later made the castle a citadel and from 1550 surrounded it with a star fort of 12 bastions, most of which were cleared under Napoleonic rule.
Much of what stands today is the work of Luca Beltrami, who restored the castle for the city between 1891 and 1905 after it passed from the army to Milan following the unification of Italy. The Torre del Filarete, blown up in 1521 when the castle served as an arms store, was rebuilt between 1900 and 1905, following 16th-century drawings, and dedicated to King Umberto I. The upper sections of the two round towers on the city side are also modern reconstructions. Allied bombing in 1943 badly damaged the castle, and the BBPR partnership rebuilt it afterwards as a museum.
Through the main gate lies a large court overlooked by the Tower of Bona of Savoy, built in 1476 during her regency, and by the Rocchetta, an inner stronghold with its own gate bearing the Sforza arms and a courtyard surrounded on three sides by 15th-century arcades. Beside it, the Corte Ducale was the dukes' residence; its larger loggia is called the Loggiato dell'Elefante after the fresco of an elephant painted there. A loggia bridge attributed to Bramante, commissioned by Ludovico Sforza, crosses at the corner of the Torre Ducale. On the side once facing the countryside, the former parade ground became Parco Sempione.
The castle's civic museums include the Pinacoteca, whose collection holds Andrea Mantegna's Trivulzio Madonna and paintings by Titian, Tintoretto, Vincenzo Foppa, Tiepolo and Canaletto; an ancient art museum with an armoury and a tapestry room; a museum of musical instruments; prehistoric finds belonging to Milan's Archaeological Museum; and the Antique Furniture & Wooden Sculpture Museum. A separate museum is given to the Rondanini Pietà, Michelangelo's last sculpture. The Biblioteca Trivulziana, the city library inside the castle, keeps the Codex Trivulzianus, a notebook of Leonardo da Vinci's writings and sketches, and a 1337 illuminated codex of Dante's Divine Comedy.




