Pepito's father, Rafael Costa de Quintana, was doctor to Ferdinand VII; his mother was the daughter of Jaime Bonells, doctor to the Alba family. The portrait is most closely related to works that Goya painted shortly after 1810 and seems to allude to the Spanish War of Independence, 180814. Pepito's jacket is tailored in imitation of a soldier's uniform, and his hair is cut in the Napoleonic fashion. The military analogy is further enhanced by the drum and the toy rifle with a fixed bayonet. Pepito's pose is unquestionably intended as a variation on the so-called dismounted equestrian portrait, popular among military figures and royalty during the seventeenth and eighteenth centuries.