It was painted over the course of three sessions in June 1644 in Fraga, where Philip IV had moved the royal court as part of the "Jornada de Aragón" which resulted in the recovery of Lérida from France, which had occupied the city earlier during the Reapers' War.
[2] Much is known of the circumstances surrounding the painting of the portrait due to extant expense accounts, including masonry costs related to the creation of two windows in the throne room where the king was to pose, as well as expenses related to the renovation of the facilities that Velázquez used as a studio, which had been in a ruinous state.
The painting was finished before the end of June, and was sent to Philip IV's wife Elisabeth, who ordered its public exhibition.
[3] José Pellicer in his Avisos históricos noted that on August 16, 1644 that a painting of the king portrayed "in the same way that he is in the field", dressed in red and silver, had been exhibited in the church of San Martín, "under a canopy embroidered with gold, where many people came to see it and copies are being made of it".
[4] Jonathan Brown suggests that Velázquez's composition might have been inspired by Anthony van Dyck's, Cardinal-Infante Ferdinand of Austria, which had been in Madrid since 1636.