The Galloway Hoard, which is made up of more than 100 items of gold, silver enamel, glass and silk, was discovered by metal detectorist Derek McLennan on Church of Scotland land in 2014.
Disappointment was felt in Dumfries and Galloway after it lost out in the race to buy the treasures, with National Museums Scotland able to raise the £1.98m needed to secure the collection.
Keeping the hoard in area was regarded as a major opportunity to boost tourism and illuminate its rich history.
Now, the hoard will go on show at Kirkcudbright Galleries for nine months from December 2020 after a 25-year agreement was signed between NMS and Dumfries and Galloway Council.
A long-term display of a number of items has also been secured.
Dr Gordon Rintoul, Director of National Museums Scotland said: “We are delighted to make this joint announcement with Dumfries and Galloway Council of a 25-year Partnership Agreement.
“National Museums Scotland is keen to extend access to the national collections to people from across Scotland and beyond and this agreement helps to achieve that ambition.
“We hope that as many people as possible from the local area or visitors to it, will take the opportunity to view the Hoard and enjoy this wonderful collection.”
Kirkcudbright Galleries will now also be used as a venue for touring exhibitions from the national collections.
Councillor John Martin, vice chair of Communities Committee at the local authority, said: “The agreement is very significant. I would like to thank National Museums Scotland for working with the Council to broker an arrangement which provides both organisations with a very satisfactory outcome.
“I look forward to seeing the Hoard return home to tell part of the story of our cultural heritage.”