Two Liverpool care homes that had faced closure as a result of the Covid-19 pandemic will now stay open.
Millvina House in Everton and Brushwood in Speke both said they did not have enough residents to remain financially viable.
Liverpool City Council has now negotiated for operator Shaw Healthcare to keep them open until next year or until a new provider can take over.
Liverpool Mayor Joe Anderson said he was "very pleased".
The homes have 132 employees and 83 residents with dementia.
Mr Anderson tweeted: "Very pleased to announce that in discussions with Shaw Healthcare we are able to make this announcement today to keep the care homes operating until next year."
Shaw Healthcare said earlier coronavirus had led to a national reluctance for families to home elderly relatives.
It meant the homes had suffered "significant and unsustainable losses".
Laura Donovan-Hall, whose 85-year-old grandmother Freda is at Millvina House, said it was "what we've been pushing for to just get us through the winter, because that's what we were so concerned about".
"It gives us the time now to find a long-term, sustainable solution," she added.