The Pennsylvania Academy of the Fine Arts has acquired a major painting by Frederic Edwin Church, a defining figure of the Hudson River School, after the 1875 oil failed to sell at a public Sotheby's auction Wednesday in New York.

Valley of Santa Isabel, New Granada had been on display at the Berkshire Museum for over a century until officials there made the highly controversial decision to sell about 40 works from the museum collection to raise money for an endowment and capital repairs and improvements.

That plan was stalled by a  challenge from Massachusetts' attorney general. But this past winter, the attorney general reached an accommodation with the museum and a judge allowed the planned sale to go forward.

Valley of Santa Isabel, however, did not sell at Wednesday's auction. Sotheby's placed a preauction sales estimate on the work of $5 million to $7 million.

PAFA said it acquired the work in "a private sale," and declined to say how much it paid for the painting, which is five feet wide and features a valley dissolving into distant mountains with three lilliputian figures in the foreground.

It is not uncommon for works that fail to sell at auction to be sold privately soon after the last gavel falls, or, more accurately, fails to fall.

Brooke Davis Anderson, director of the PAFA museum, called Valley of Santa Isabel "a great Church painting, one of his best paintings."

The academy has been seeking to build up its collection works by Hudson River painters for several years — using funds generated by sometimes highly controversial sales out of its own collection.

The most notable instance of this was PAFA's 2013 sale of one of its two paintings by Edward Hopper, sold at auction for about $40 million. The Hopper vanished into a private collection.

Other works sold recently to build up PAFA acquisition funds include paintings by William Merritt Chase, Childe Hassam, John H. Twachtman, Maurice Prendergast, and Frank Weston Benson.

Such sales are commonly — if sometimes painfully — used by museums to build their collections, and are deemed ethical by professional associations. Sales of works for other purposes — such as the Berkshire Museum's effort to raise capital and endowment funds via art sales — are not sanctioned professionally.

In recent years, PAFA has used acquisition funds bolstered by collection sales to acquire Hudson River School and related works by Albert Bierstadt, David Johnson, William Frederick de Haas, Thomas Moran, among others.

The acquisition of the Church painting now gives the academy a critical mass in Hudson River paintings.

In a statement, Anna Marley, PAFA's curator of historical American art, noted that the Church "will be the largest and most significant painting of the Hudson River School in the collection."

"It will join works in the collection by his contemporaries Thomas Cole, Asher Brown Durand, John F. Kensett, Edward Bannister and Jasper F. Cropsey,"  Marley continued. "It will also complement our recent purchase of Bierstadt's sublime painting of Niagara Falls."

"We're already planning an exhibition strategy for the painting," Anderson said, referring to the Church. "PAFA is committed to telling the sweeping story of America art, and Church is a key part of that story."

"We've made a commitment to the artwork," she continued. "The good news is it remains in the public domain."

PAFA has decided, in that regard, to extend an invitation to every member of the Berkshire Museum and every resident of Berkshire County, Mass., to visit the painting at any time for free "in perpetuity."

She said she was not certain when the painting would arrive and go on display.