The number of patients having to wait longer than the target time to be discharged from hospital has risen again, new figures show.

In October this year, 321 patients were delayed more than four weeks after they were ready to be sent home, according to NHS statistics.

The figure compares with 274 in July and 156 in October 2013.

Delayed discharges - also known as bed blocking - happen when patients are ready to leave hospital but their necessary care, support and accommodation arrangements are not yet in place.

The current target states that nobody should wait more than four weeks from when they are clinically ready to be discharged, with that target set to come down to two weeks next April.

Of the 321 patients who were delayed, 145 were waiting for a place to become available in a care home. A further 90 were waiting to return to their own home.

The figures also show there were 215 patients delayed for more than six weeks in October this year, compared with 175 in July and 100 last October.

Health Secretary Shona Robison said: "Reducing delayed discharge and tackling its impact on services is something I will take forward as an absolute key priority.

"That is because reducing delayed discharge not only helps individual patients, who benefit from getting home or to a homely setting as quickly as possible, but also eases pressure across the system - including in A&E.

"Although delayed discharge has been reduced by two-thirds under this Government, these figures show that there is still much to do.

"Working closely with local authorities, the NHS must reduce the number of people waiting in hospital for appropriate care services to be arranged in the community. A taskforce has been set up with Cosla to make this happen.

"This builds on the significant progress made to devise new and innovative ways to improve the flow of patients through health and care services.

"We will continue to support this work, together with our partners in the NHS and local government, to reshape the health and social care system as we work towards integration coming into force in April next year."

Conservative health spokesman Jackson Carlaw said: "The picture on delayed discharge just seems to get worse and worse.

"Every three months the Scottish Government pledges action on this, yet the statistics move in the other direction.

"You just have to look at the hundreds of thousands of bed days lost each year to see the impact this is having on resources in the NHS.

"Given the new First Minister was health secretary for several years, there should finally be an opportunity to give this matter some serious priority."

Liberal Democrat health spokesman Jim Hume said: "If this is the scale of pressure on our hospitals during the summer months then it seems that our health boards are to face a long winter.

"We need assurances that our health service is prepared fully for any increase in demand this winter.

"Today's figures are a worrying indication of the state of preparedness of health boards across Scotland."

Labour MSP Rhoda Grant said: "Bed blocking is a significant issue for Scotland's NHS, draining essential resources from an system already stretched to breaking point.

"As Shona Robison takes over from Alex Neil she must answer Scottish Labour's call for a wholesale review of the NHS in Scotland - including the provision of social care - making sure we have NHS fit for the 21st century."

Theresa Fyffe, director of the Royal College of Nursing in Scotland, said: "One of the worrying aspects of the figures published today is that we've not yet hit the winter months.

"If this is happening over the summer months, what's it going to be like in between December and February, when many more patients - particularly our most elderly and vulnerable - are admitted to hospital?

"As a matter of urgency, we now need a review of all of our NHS so it's put on a sustainable footing for the future."

Councillor Peter Johnston, Cosla's health and well-being spokesman, said: "We recognise that getting people out of hospital in good time is fundamental to them regaining their independence and improving their health and well-being.

"Indeed, just last Friday, council leaders convened in Edinburgh to make a landmark decision to begin to focus on discharge within 72 hours of people being judged clinically ready to go home.

"At the same time, a commitment to reform and progressive ideals will not in itself deliver the improvement required.

"We will need to reflect on how we can build social care capacity to make the system work more effectively and this will require heavy investment over the next few years.

"We will work with our partners in the Scottish Government and NHS Scotland to consider how this is best achieved."