Morrisons will pull out of its Dumfries House livestock farming partnership in November.
The retailer has farmed the 1,000-acre estate since 2009, using it as a base for its research and development projects into farming sustainability and livestock genetics.
However, it said time had come to hand control of the farm back to the Dumfries House Trust.
“The Dumfries House project was an exceptional opportunity for us to explore and develop farming practices,” said Morrisons group corporate services director Martyn Jones.
A Dumfries House Trust Estate spokesman said it was “indebted” to Morrisons for its significant investment.