The portrait, which is believed to depict Lady Elizabeth Yorke (1725-60) who lived at the hall from age 15 until her marriage in 1748, had hung in the property for many years previously.
The owner then offered to sell it in 2014 but the NT was unable to raise funds.
The painting was then returned to the lender earlier this year and scheduled for auction at Sotheby’s.
However, at the last moment an anonymous donor came forward to help secure the portrait. The owner withdrew it from auction, in agreement with Sotheby’s, and it was sold to the NT through the government’s private treaty sale scheme. The purchase price was a five-figure sum and the NT undertook a market value and independent assessment to ensure it paid the right price.
Yorke was the eldest daughter of the first Earl of Hardwicke (1690-1764) and married Admiral George Anson (1697–1762) in 1748. She was heavily involved in political life and corresponded with many of the leading intellectuals of her day, including her sister-in-law Jemima Yorke, whose portrait is also on display at Wimpole.
Iain Stewart, senior collections and house manager, said: “After so long, I never imagined that anyone would actually come forward and offer to help with the acquisition. We’re delighted to finally be able to acquire the portrait – we have missed it greatly and it left a considerable gap in our picture hang and presentation of the Yorke family story.”