The painting had been purchased by art lover Sir Robert Child at the beginning of the 18th century and became one of the works in the Osterley art collection.
It is recorded in its 1782 inventory and remained there until it was sold along with other family heirlooms in the 1930s.
Now, the National Trust, which bought the picture at a Christie’s auction last summer, will put it on display at the property again this autumn.
The total auction price of £248,750 at the Old Masters evening sale in London on July 5, 2018, was met with help from various donations including £85,000 from the Art Fund. Sums were also received from private donors, trust members and visitors to the house as well as from a fund set up by the late Simon Sainsbury to support acquisitions for the historic houses of the National Trust.
Following the purchase the painting has been conserved and restored and will go on show as part of a new exhibition called Treasures of Osterley – Rise of a Banking Family at the house in November.
The painting by the 17th century Florentine artist depicts the moment St Peter the Apostle appears in a vision to the tortured Agatha of Sicily to heal her wounds.
John Chu, National Trust assistant curator of pictures and sculpture, said: “Although an extraordinary number of original furnishings remain at Osterley, its once-famous picture collection has been almost completely dispersed or destroyed…. It is fantastic when a rare opportunity arises to purchase one for the property.”