The gallery was the result of the cultural policies of Pope Benedict XIV, who sought to protect Roman artistic heritage from dispersal. Acting through Cardinal Silvio Valenti-Gonzaga, the Pope acquired two major local collections. In 1748, 187 paintings were purchased from the Sacchetti family, who were forced to sell to creditors. Shortly after, when Prince Giberto Pio sought to move his family collection to Spain for sale, the Pope granted permission on the condition of preemption, subsequently acquiring 126 paintings from the Pio di Savoia collection in 1750. Dedicated rooms were constructed in the palace to house these core ensembles. In 1818, the arrival of Guercino's altarpiece necessitated the relocation of several existing works. The gallery later compensated for these shifts through significant acquisitions in the 19th and 20th centuries, including 14th- and 15th-century panels from the Sterbini collection.