A study for one of four pictures commissioned in 1735 by King Philip V of Spain from the artist on the recommendation of the King's architect Filippo Juvarra for the palace of San Ildefonso at La Granja near Segovia, F. Arisi, Gian Paolo Pannini e i farsti della Roma del' 1700, Rome, 1986, p. 353, no. 244. Close collaboration with the famous architect had already led Pannini to paint for Duke Vittorio Amedeo II of Savoy a pair of views of the castle of Rivoli which Juvarra was then in the process of completing. Although a French Bourbon, King Philip commissioned many artists working in Italy to paint decorations for his palace, among them Orizzonte, Conca, Imperiali, Trevisani and Costanzi.
Although bozzetti for the other three compositions have survived, none related to the present one has been traced. However a drawing studying the central group of figures, executed in a similar technique to that of the present sheet, was sold in these Rooms, 2 July 1991, lot 119. Another drawing of the same composition, different in format, is at the Albertina, V. Birke and J. Kertész, Die Italienischen Zeichnungen der Albertina, Vienna, 1997, IV, no. 14430.
Pannini had already treated a similar subject in 1725 in a picture now at the Prado, which was bought a century later by King Charles IV of Spain for his Casa del Campo at the Escorial. This reveals the level of popularity the Granja cycle had enjoyed at the Spanish court during the 18th Century.