The Scottish Government has been accused of leaving the NHS "stuck in the waiting room" after the First Minister confirmed more than 53,000 patients failed to get treatment within a legally binding waiting time.

Nicola Sturgeon said that since the start of the Treatment Time Guarantee in 2012, which states eligible patients will be treated within 12 weeks of their care being agreed, there were 53,257 cases where people had waited longer than that.

Labour leader Kezia Dugdale pressed her on the figure at First Minister's Questions, saying: "That's a legal guarantee to 53,000 broken, and in fact the last few months have been the worst on record.

"These aren't just statistics, it is pensioners in need of a knee replacement having to wait for months, or people waiting for eye surgery facing delay after delay."

She added: "Isn't it the case that under the SNP, the NHS is stuck in the waiting room while the First Minister plots a second referendum?"

Ms Sturgeon said that while there were 53,257 cases of patients waiting more than 12 weeks, since 2012 a total of 1,267,000 have been treated within this time.

She told the Labour leader: "Waiting times are lower than they were when we took office, but we have work to do because of rising demand in our service, and we will continue to ensure our health service has the investment and record numbers of staff so we can continue to provide the best care and treatment for patients across the country."

She added: "It's worth pointing out when this Government took office there were only 85% of patients treated within 18 weeks.

"Not only have we reduced waiting times from 18 weeks to 12 weeks, a higher percentage of patients are now being seen within that shorter waiting time. That's the progress we're making.

"We also see record numbers of staff working in the health service and we see record levels of investment in our health service.

"We have rising demand for our health service, that's why we continue to invest, to build up the capacity of our health service, so that we can continue to ensure more and more patients get seen within these shorter waiting times."

Ms Dugdale condemned the First Minister for bringing up "a 10-year-old record of a Labour government", adding that this "just doesn't cut it with patients".

The Labour leader said: "Each time I bring an individual case to this chamber the First Minister promises to deal with it. It would take centuries for me to work through each of these 53,000 cases."

Ms Sturgeon, however, insisted it was "perfectly reasonable" to look at the situation the SNP inherited when it came to power in 2007.

She said: "When we took office, as I said, 85% of patients in Scotland were being seen within 18 weeks at that time. Now there are almost 90% of patients being seen within 12 weeks. So the waiting time is shorter and the percentage of patients being seen within it is larger.

"That is progress in anybody's language. But it's not enough progress, that is why we are committed to continuing to increase investment by £500 million more than inflation over this Parliament."