A patient spent more than 600 days in one of the region’s hospitals despite being given the all-clear to go home.
And more than 100 patients spent more than three weeks in hospital last year despite being deemed well enough to leave.
The bed blocking data was released by the Scottish Liberal Democrats following Freedom of Information requests.
Party leader, Alex Cole-Hamilton, said: “Delayed discharges have a huge impact on patients and their families.
“Once you are declared fit to leave, there is nothing more disheartening than being forced to wait in a hospital as the days tick by.
“Delayed discharges involve eye-watering sums of money for the NHS and in the majority of cases it is an entirely avoidable problem.
“Most people are waiting on a care home place, social care support to enable them to live in their own home or for an assessment to be conducted.”
A delayed discharge is when doctors have deemed a patient well enough to leave but they have to wait for outside assistance – such as social care or a place in a care home – to be put in place.
The Lib Dems asked all 14 Scottish health boards for data on the matter for 2020/21.
NHS Dumfries and Galloway had the highest average delay of the 12 health boards that responded, with patients spending on average 34.5 days in hospital after being given approval to leave.
A total of 111 patients in the region spent more than three weeks in hospital unnecessarily.
And in one case, a patient was kept in for a staggering 617 days after being given the all-clear to go home.
A spokesman for the region’s health board said it had one of the lowest rates of delayed discharges as a share of population in the country.
He said: “One of the key challenges impacting on the ability to discharge people in a timely manner from hospital is securing care packages to support people in their own homes.
“Recent success recruiting 32 staff to Dumfries and Galloway Council’s in-house care and support services equates to a further 784 hours of care provision – supporting the care at home visits in our region which now total 80,000 every single week.
“Ongoing recruitment activity in care at home services is supported by the increase in pay for this sector announced by the Cabinet Secretary for Health and Social Care.
“As that work continues successful ongoing recruitment saw 14 additional whole time equivalent health and care support workers added in September to help support care at home services.
“It is not possible to address individual cases of delayed discharge.
“But there can be many factors which result in protracted delays within a rural region which has an ageing population with increasingly complex health and social care needs – ranging from availability of specialist nursing beds or suitable accommodation within the community to legal issues around capacity and guardianship.”
Public Health Scotland has previously estimated that each bed day of delayed discharge costs the NHS £262.
And according to Holyrood seven per cent of all occupied beds in 2019/20 were taken up at a cost of £142 million.
A Scottish Government spokeswoman said: “The last few months have seen extreme pressures across the whole health and social care system and this has seen more people coming through hospitals who need high levels of care and support to go home.
“We are working alongside our health boards and local partners with urgency and pace to safely discharge people to their own homes, or to an appropriate care home or community setting.”