In 1499, the political situation in Milan took a turn for the worse. The French began an invasion of Lombardy, and Sforza promptly fled to Germany. When the French conquered the city, Leonardo and Pacioli left together for Mantua. Sforza would eventually try to recapture Milan using Swiss mercenaries, but these forces eventually betrayed him, having taken a bribe from the French.
In 1499, Leonardo was 47. His three greatest paintings at that point were the Adoration of the Magi, which was incomplete, the Virgin of the Rocks, which was ensnared in a legal battle over rights to its ownership, and the magnificent Last Supper, which was already deteriorating. The Last Supper had been a chance to create something permanent–something that would be painted on stone as opposed to canvas–but the mural was now already vanishing. Leonardo was widely considered to be a master, but he seemed incapable of creating anything that would "last," in the most literal sense of the word. Even the model for the giant bronze horse had met its destruction, at the hands of idle soldiers. He was surely a dissatisfied man.
The entry of Salai into Leonardo's household, however, must have raised the artist's spirits. Whatever their relationship, whether innocent or romantic, Leonardo harbored a great fondness for the boy, and would take a series of young male pupils into his household following Salai's arrival. If the Caterina who joined Leonardo in 1493 was truly his mother, then this must have further heartened the aging master.
It is remarkable that in the face of so many failures, Leonardo was still devouring new fields of research, quickly attaching himself to Pacioli. In the coming years, his skills would only become more eclectic.