Two doctors who have been working as locums GPs at Lockerbie Medical Practice will take over the running of the surgery from June.
Dr Michael Ramsden will head the practice with Dr Kashif Ahmad after being awarded the contract responsible for almost 5,000 patients.
It ends months of uncertainty since Lanarkshire-based Alba Medical Group – who took over on April 1 last year – gave notice on their contract and will leave on May 31.