The only Royal British Legion (RBL) care home in Wales has been saved from closure.
Crosfield House in Rhayader, Powys, is home to about 50 elderly ex-servicemen and others, and employs up to 90 staff.
The RBL said an "established Welsh care home provider" was set to buy it as a going concern after it was put on the market last year.
Rhayader mayor Lee Price said it was fantastic news for the town and local economy.
The future of the home had been in the balance since 2008, when it emerged that it was facing a deficit of £500,000.
An RBL spokesman said: "I can confirm that the board of trustees has found a suitable buyer for Crosfield House in Rhayader.
"We have received an acceptable offer from an established Welsh care home provider, but we are unwilling to reveal the company's identity until contracts have been exchanged.
"The agreement is for Crosfield House to be taken over as a going concern with no changes to staff.
"When we announced last year that we were to sell Crosfield House, we said our preferred course of action would be to sell the home as a going concern."
Ms Price said: "Crosfield House is one of the largest employers in the town and it would have devastated the local economy had it closed.
"Special thanks must go to Councillor Clare Evans, a former town mayor, who has worked tirelessly to secure the future of the home."