Leonardo was called back to Milan in 1506 by the French occupiers of the city, and he served the court there for much of the next seven years. He began his last known painting, the Madonna and Child with St Anne, possibly for the King of France, but he was now working more as an all-purpose designer than as a painter.