Prince Charles has helped to secure an historic Scottish mansion and its 2,000 acre estate for the nation.
The house was originally put up for sale three years ago
Completed in 1759, Dumfries House in Cumnock, Ayrshire, was originally put up for sale by the Marques of Bute three years ago.
The house contains some of the most important collections by master furniture-maker Thomas Chippendale.
The prince, known as the Duke of Rothesay in Scotland, helped to co-ordinate the £45m sale.
Christie's and Savills said that the house had been acquired for the nation by a consortium of organisations including the Scottish government, the Art Fund, the Garfield Weston Foundation, the Monument Trust, the National Heritage Memorial Fund and SAVE Britain's Heritage.
The Prince's Charities Foundation has borrowed a considerable proportion of the £45m total cost of the project.
Christie's has announced that the sale of the house's contents, due to be held on 12 and 13 July, will not proceed.
Prince Charles said he was very relieved that the house and its contents had been saved for the nation and was very grateful to all those who had worked to make it possible.
John Bute, who was a Formula One racing driver under the name Johnny Dumfries, first announced his intention to sell Dumfries House three years ago
He said: "Dumfries House and its contents will remain intact as a unique example of Georgian craftsmanship.
"Since announcing my intention to sell Dumfries House in 2004, considerable effort has been made by all parties involved to reach this conclusion.
"Dumfries House has been a private family residence since its creation in the 18th Century by my ancestor, the Fifth Earl of Dumfries, and it is my hope that it will go on to be enjoyed long into the future by a wider public."
He added: "Apart from the importance of preserving the building and contents as part of Scotland's heritage, I am also extremely optimistic about the positive impact that this development will have on the local economies of Cumnock and Auchinleck as well as East Ayrshire."
First Minister Alex Salmond said: "The house and its exquisite furniture collection are internationally acclaimed - a world class product of the Scottish Enlightenment.
"I want them to become a showcase for a newly confident Scotland; and a catalyst for increased tourism and imaginative regeneration in the south west of Scotland."
The house contains an important collection of British furniture
David Barrie, director of The Art Fund, said: "People said it couldn't be done - that there wasn't nearly enough time or it was too much money to raise.
"But this campaign shows what can be achieved when funding bodies really work together actively to achieve a common goal."
Charles Cator, deputy chairman of Christie's International, said Dumfries House was one of the finest collections of British furniture and contained the only fully documented works of art dating from Chippendale's illustrious Director Period.
Conservative MSP Jamie McGrigor said he had been campaigning over the sale of the house for some time.
He said: "The furniture collection at Dumfries House, built specially for the house, is one of the very finest in Europe and to have seen the house asset-stripped would have left it as an impotent shell."
Anna Thomas, of Savills Edinburgh office, said the sale generated a great deal of interest from buyers in UK, Ireland and internationally, resulting in strong competition at the closing date.
Trustees of the National Heritage Memorial Fund (NHMF) agreed to award a grant of £7m to help buy the house and estate.