At least 300 people died while waiting to be discharged from hospital last year, new figures uncovered by Scottish Labour have indicated.
More than a third of cases were in NHS Lothian, where 104 people died while waiting for care arrangements to be put in place that would allow them to leave hospital.
The true number of those deaths in Scotland could be higher, as several health boards only provided data for part of 2018.
NHS figures recently revealed delayed discharges – when patients have to stay in hospital despite being medically fit to leave because they are waiting for a care package – cost the health service in Scotland more than £120 million last year.
Labour uncovered the figures using freedom of information legislation.
The party’s health spokeswoman Monica Lennon said: “Hundreds of people are prevented each year from spending their final days surrounded by their loved ones in their own home due to delayed discharging from hospital.
“Often the delays are directly linked to social care services not being in place for people who should be returning home.
“These delays can unnecessarily put people at risk of acquiring infections in hospital.
“Worryingly, the problems in social care will only be made worse by £230 million worth of real-terms cuts to local government in the SNP-Green budget.”
She pledged: “Scottish Labour would ensure social care gets the staff and funding it needs, and in government we would introduce a National Care Workers Guarantee with a commitment to secure hours, a living wage and reimbursement for travel and training time.
“We are serious about protecting our NHS and delivering the real change that our communities need.”
Brian Sloan, chief executive of the charity Age Scotland, said action was needed to improve the recruitment and retention of care staff.
He said: “It’s incredibly sad to hear about so many older people dying unnecessarily in hospital while they are waiting to be discharged and returned to their home.
“It’s important that older people and their families are afforded the choice about their end of life wishes.
“There are far too many older people stuck in hospital for longer than they need to and it is a problem that doesn’t appear to diminishing.
“It’s bad for a person’s health and costs the health service an eye-watering amount of money which would be better spent in delivering social care.
“The longer an older person is in hospital, the harder it can be to leave as muscle mass reduces and frailty increases, making the risk of a fall more likely.
“In turn this could result in a return to hospital. I have personally heard from older people who are scared to ever go to hospital for fear of never leaving.”
He added: “We know there are simple and cost-effective solutions to getting people out of hospital and back into their own home, such as Care and Repair services.
“They are able to fit key safes for carers and family members, small adaptations such as a grab rail and ramps, and make sure the home is safe for the return from hospital.
“This is a much cheaper solution than keeping someone in hospital when they don’t need to be there.
“But fundamentally we’ve got to address the problems in recruitment and retention of social care staff, so that the necessary care package is deliverable once an older person is ready to leave hospital.”
A Scottish Government spokeswoman said: “We’re committed to ensuring that delays to discharge from hospital are minimised, and the ongoing integration of health and social care has been key to achieving progress in recent years. This has seen year-on-year reductions in the number of bed days lost due to delays over the last three years.
“For 2019/20 the draft Budget delivers local government almost £500 million of additional support. Through the budget local government’s total contribution to Integration Joint Boards for the delivery of adult social services will increase by a minimum of 4.4% in 2019/20.”