Leonardo went to Milan in 1482 and remained at the court of Ludovico Sforza for 16 years.
Many drawings of plans and elevations for domed churches reflect his interest in architecture probably stimulated by contacts with Bramante during these years. He worked in 1488 on a model for the drum and dome of the Duomo in Milan. In 1490 he worked as consulting engineer for the restoration of the cathedral of Pavia and later the cathedral of Piacenza. Leonardo's fresco of the Last Supper (Milan) was begun in 1495 and completed by 1498.
While at the court of Ludovico Leonardo also worked on an equestrian monument of Francesco Sforza, father of the Duke. The work has never been started, and the model, admired by his contemporaries, perished during the French invasion of 1499. After the fall (1499) of Ludovico Sforza, Leonardo left Milan and, after brief stays in Mantua and Venice, returned to Florence in 1500.
In 1506, Leonardo returned to Milan, engaged by Charles d'Amboise, in the name of the king of France, Louis XII. Here once again he worked as an architect and engineer. Featuring a huge curiosity concerning the physical world, he continued his scientific investigations, dealing with problems of geology , botany, hydraulics and mechanics. In 1510-11 his interest in anatomy quickened considerably. At the same time , he was active as a painter and sculptor, had many pupils, and profoundly influenced the Milanese painters. A painting generally ascribed to this period is St. Anne, the Virgin and Child (Louvre), a work that exemplifies Leonardo's handling of sfumato, subtle transitions of tone.