Urgent action is needed to attract more nurses into Wales' independent care sector so it can relieve pressure on hospital bed use, says a campaigner.
Care Forum Wales chair Mario Kreft said a shortage of care home nurses was at risk of becoming a "crisis".
He spoke out after it emerged two homes in the Bridgend area were to close, citing nurse recruitment problems.
The Welsh government said it would work to ensure the care and safety of residents in the homes closing.
HC-One, which owns Abergarw Manor in Brynmenyn and Southmead Grange in South Cornelly, blamed "a national shortage of nursing staff" for the "very difficult decision" to close the homes.
Mr Kreft said closures are symptomatic of the problems affecting care homes across Wales as the way social care is commissioned is "flawed".
He said: "There are a total of over 20,000 beds in the independent social care sector in Wales and of those, 11,500 beds are for people who need nursing care - and these beds are underpinning the ability of the NHS to function.
"The owners of the two homes in Bridgend have been quite clear that for them the overriding issue was the lack of nurses, the inability to recruit enough nurses of the right calibre.
"If we don't bring more nurses into the independent sector then we're going to find that the closures which will inevitably come about will mean that more people will have to reside or find their services in a hospital bed.
"That means we are sleepwalking into a perfect storm of rising need, dwindling resources and a recruitment crisis unless urgent action is taken."
Mr Kreft said the level of morale and motivation in Wales' care sector is "probably the lowest that it has been in 30 years".
He added: "The commissioning process has to reflect the people that we need to employ and retain.
"Our strategy should be interlinked so that we can work in partnership with our colleagues in health boards, with Welsh government, to ensure that we're attracting the right people into social care.
"It is a fact of life that looking after people in hospital is a lot more expensive that providing care in a nursing home which stops unnecessary routine admissions to hospital."
A Welsh government spokesperson said: "Health boards and trusts are responsible for identifying the workforce needs for their populations.
"The Workforce Education and Development Service works with health boards to understand the requirements of sectors other than the NHS, such as care home nurses.
"This is taken into account each year when pre-registration education places are commissioned."