In 1478, by age 26, Leonardo left Verrocchio's studio and was no longer a resident at his father's house. One writer, called the Anonimo Gaddiano, claims that in 1480 Leonardo was living with the Medici and working in the Garden of the Piazza San Marco in Florence, a Neo-Platonic academy of artists, poets and philosophers that the Medici had established. In January 1478, he received an independent commission to paint an altarpiece for the Chapel of St. Bernard in the Palazzo Vecchio; in March 1481, he received a second independent commission for The Adoration of the Magi for the monks of San Donato a Scopeto. Neither commission was completed, the second being interrupted when Leonardo went to Milan.
The Adoration of the Magi (1481), Uffizi
At the start of the Second Italian War in 1499, the invading French troops used the life-size clay model for the Gran Cavallo for target practice. With Ludovico Sforza overthrown, Leonardo, with his assistant Salai and friend, the mathematician Luca Pacioli, fled Milan for Venice, where he was employed as a military architect and engineer, devising methods to defend the city from naval attack. On his return to Florence in 1500, he and his household were guests of the Servite monks at the monastery of Santissima Annunziata and were provided with a workshop where, according to Vasari, Leonardo created the cartoon of The Virgin and Child with St Anne and St John the Baptist, a work that won such admiration that "men and women, young and old" flocked to see it "as if they were attending a great festival".
In Cesena in 1502, Leonardo entered the service of Cesare Borgia, the son of Pope Alexander VI, acting as a military architect and engineer and travelling throughout Italy with his patron. Leonardo created a map of Cesare Borgia's stronghold, a town plan of Imola in order to win his patronage. Maps were extremely rare at the time and it would have seemed like a new concept. Upon seeing it, Cesare hired Leonardo as his chief military engineer and architect. Later in the year, Leonardo produced another map for his patron, one of Chiana Valley, Tuscany, so as to give his patron a better overlay of the land and greater strategic position. He created this map in conjunction with his other project of constructing a dam from the sea to Florence, in order to allow a supply of water to sustain the canal during all seasons.
Leonardo's very accurate map of Imola, created for Cesare Borgia
Leonardo returned to Florence, where he rejoined the Guild of Saint Luke on 18 October 1503. He spent two years designing and painting a mural of The Battle of Anghiari for the Signoria, with Michelangelo designing its companion piece, The Battle of Cascina. In Florence in 1504, he was part of a committee formed to relocate, against the artist's will, Michelangelo's statue of David.
n 1506 Leonardo returned to Milan. Many of his most prominent pupils or followers in painting either knew or worked with him in Milan, including Bernardino Luini, Giovanni Antonio Boltraffio and Marco d'Oggiono. At this time he may have commenced a project for an equestrian figure of Charles II d'Amboise, the acting French governor of Milan. A wax model survives and, if genuine, is the only extant example of Leonardo's sculpture.
Leonardo did not stay in Milan for long because his father had died in 1504, and in 1507 he was back in Florence trying to sort out problems with his brothers over his father's estate. By 1508 Leonardo was back in Milan, living in his own house in Porta Orientale in the parish of Santa Babila.