Nicola Sturgeon has defended the creation of a legally binding 12-week treatment time guarantee for NHS patients – but conceded this has been broken more than 100,000 times.

Scottish Liberal Democrat leader Willie Rennie told the First Minister that if a member of the public had broken the law as often as this one had been breached they would be put behind bars in Glasgow’s Barlinnie Prison.

He pressed the SNP leader on the issue at First Minister’s Questions after a new action plan to cut NHS waiting times – unveiled by Health Secretary Jeane Freeman on Tuesday – revealed the 12-week treatment time guarantee was not expected to be fully met until 2021.

The guarantee was introduced by the SNP in 2012, when Ms Sturgeon was the health secretary, and set out in law that patients should wait no more than 12 weeks for either inpatient or day surgery.

But in the the period of April to June this year, it was met for just less than three quarters (74.6%) of patients, official figures showed.

Mr Rennie hit out: “The law states that patients will be guaranteed NHS treatment within 12 weeks. This is the First Minister’s law, from when she was health secretary.

“It was an SNP flagship law that helped them take power in 2007. And it is a law that the SNP Government has broken over 100,000 times.

“But on Tuesday the Government said they would keep on breaking the law for another three years.”

He added: “If a member of the public was to break the law this many times, they would serve time in Barlinnie.

“Why is it when the SNP Government breaks the law they think they can get away Scot free?”

Ms Sturgeon said: “The 12-week treatment guarantee, yes it has not been adhered to more than 100,000 times, but 1.6 million patients have been treated within that, patients that might have waited over 12 weeks without that guarantee.”

She continued: “There are now fewer people waiting more than 12 weeks for treatment than was the case when this government came to office.”

Meanwhile, the Scottish Government has committed to invest £850 million in efforts to cut waiting times, with Ms Sturgeon insisting the proposals will “substantially and sustainably reduce waiting times”.

While she stated the “vast majority of patients” are seen within waiting times targets, the First Minister added: “Demand on our NHS is rising. That is largely because of the ageing profile of our population, and that is putting enormous pressure on waiting times.

“So what the Health Secretary did this week is be utterly transparent about those challenges, the impact they are having right now and what the funded plans are that we have in place to address those challenges and to substantially and sustainably reduce waiting times. I think that is the right way to go.”

She continued: “I think it is important and right for us to be fully frank, honest and transparent with parliament about the nature and scale of the challenge we are facing, so the Parliament can hold us to account as we work through this plan in the years ahead.”