In December 1476 Galeazzo Maria fell victim to a conspiracy and was assassinated. His widow, Bona di Savoia, became regent on behalf of the young Duke, Gian Galeazzo Maria. She retreated with her son to the central tower, which she raised in order to control the entire castle, and which to this day still carries her name.
Her regency however was not to last, Galeazzo Maria's brother, Ludovico Maria, known as il Moro, soon took power and sent Bona into exile. A connoisseur of the arts, il Moro transformed the court of Milan into one of the most refined of the time, with artists such as Donato Bramante and Leonardo da Vinci benefiting from his patronage. Among the masterpieces that stand as a testament to his reign are Leonardo's Sala delle Asse and the decoration of the Treasure Room that the Duke commissioned of Bartolomeo Suardi, also known as il Bramantino in 1490.
The projects to render the castle ever more sumptuous were interrupted in 1497, when, contemporaneously his spouse, Beatrice d'Este died in childbirth and the French troops marched upon Milan. The Duke made preparations to resist the impending attack by cleaning out the moats, covering the ravelins (fortifications for the gates), filling the castle walls, and gathering supplies, ammunition and artillery. Fearing also a popular uprising il Moro decided to seek refuge at the court of the Habsburg Emperor Maximilian I, leaving the castle governor in charge of defending the fortress. After a series of vicissitudes, he eventually reconquered Milan in 1500. Ludovico il Moro died a prisoner in France in 1508.