Although born in London, Casanova was of Venetian parentage (indeed his elder brother was the celebrated memoirist, Giacomo Casanova) and it was in that city that he received his initial artistic training in the studio of Francesco Guardi. He then moved to Florence, entering the studio of the Venetian landscape painter Simonini, whose influence may be seen in the present work. At the age of 24, Casanova traveled to Paris, where he trained with Parrocel for one year, before spending six years in Dresden. He then returned to Paris and was elected a member of the French Royal Academy of painting and Sculpture in 1763. He also worked for the French Crown, providing drawings for the Beauvais tapestry factory, and for Catherine the Great, who employed him to paint a series of pictures to commemorate the victory of Potemkin over the Turks.
The present work probably dates from Casanova's first years in Paris after his return from Dresden and before his admission to the Academy in 1763, when he was influenced by Boucher. There is a sketch in pencil and washes for a pendant to this painting depicting the herd returning with the same herdsman and donkey (a photograph of this is in the Frick Art Reference Library, New York).