SNP minister Keith Brown admitted hundreds of prisoners were given an incorrect risk assessment score and could have been released incorrectly in a huge IT glitch.
Offenders in jails are given a score which judges how much of a threat they pose to the public.
But the blunder meant new information was not added to calculate their overall risk level.
Tory shadow justice minister Jamie Greene blasted the SNP over the “scandalous error” which he claimed “may have put the public at risk”.
It’s understood the issue may go as far back as 2012, when Kenny MacAskill held the justice ministerial brief.
Since then senior SNP MSPs Michael Matheson and Humza Yousaf have also held the role.
Mr Brown said that a total of 1,032 closed cases had been given an initial inaccurate risk assessment.
In 537 cases, social workers used an override with their own judgement which amended the error.
But the SNP minister admitted that 495 assessments appear to have been mistaken after the IT system was centralised by the SNP.
‘No wrongful releases’
Mr Brown said that 150 wrongful risk scores that had been checked so far and no criminals appear to have been wrongfully released early.
He said: “Officials have taken immediate action to review open cases that the justice system is still managing.
“No users of the system – social worker or SPS – have advised the Scottish Government of any public protection risk as a result of this system issue.”
But Jamie Greene said: “This is a horrendous blunder that may have put the public at risk.
“It is scandalous that hundreds of criminals may have been wrongly released from prison when they should still be serving sentences.
“This is a grave error on the justice secretary’s watch no matter how he spins it.
“He claimed that the public have not been put at risk but the reality is he doesn’t know yet.
“He has absolutely no idea if this mistake has resulted in harm to the public. That is shocking and unforgivable.
“We need to know urgently from the SNP how many criminals were wrongly released from prison early.”
Earlier this year Keith Brown claimed “credible and consistent” alternatives were needed to custodial prison sentences were needed to reduce jail numbers.