A senior judge has criticised the system of automatic early release for convicted sex offenders.
Lord Hardie called for better monitoring of offenders
Lord Hardie spoke out as he sentenced a Lanarkshire man to six years for abusing a young boy.
The High Court in Glasgow heard James Steele committed the offence months after being released early from a jail term for abusing two other boys.
The judge ordered that Steele should be closely supervised for a further 10 years on his release.
Steele had been sentenced to eight years in September 2000 for abusing two youngsters.
The judge in that case gave him an extended sentence of four years to be served in the community while he was being monitored by social workers and police.
But Steele was out after only four years and eight months.
During the court appearance for the latest offence, it was revealed that Steele groomed a family while he was on licence so he could sexually abuse their 12-year-old son.
The court heard on Friday that the family had no idea that Steele was a convicted paedophile until social workers warned them not to allow him near their child.
However, the warning came too late because Steele had already sexually abused the boy two weeks before.
Lord Hardie said the case illustrated the dangers associated with the system of automatic release of prisoners introduced by the then government in 1993.
He said the issue was shortly to be examined by the Scottish Parliament.
The judge said: "In considering alternative proposals the Scottish Parliament may wish to consider the circumstances of this case from which it is clear that any decision to release prisoners must be based upon an assessment of risk undertaken after the prisoner has completed a substantial part of the sentence imposed by the court.
"Such decisions cannot be taken when sentence is pronounced.
"Moreover adequate resources must be provided to any alternative system to ensure full risk assessments and proper monitoring following release to be undertaken.
"The absence of such safeguards will result in the public being exposed to unaceptable risks from prisoners released prior to the end of the sentence imposed on them."
A Scottish Executive spokespoerson said: "The reforms build on the proposals from the Sentencing Commission's report on early release and will mean that all offenders will be under restrictions for their entire sentence.
"The legislation to deliver these changes will be introduced to parliament shortly."
Currently, under the Prisoners and Criminal Proceedings (Scotland) Act 1993, offenders sentenced to less than four years are automatically released after serving half of their prison sentence. Those sentenced to four or more years may be released on licence at the halfway point if directed by the Parole Board. If not, they can be released after serving two thirds.
Lord Hardie ordered the sentence on Steele to begin when he has completed the three years and four months of the unexpired portion of his last sentence.
Steele, from Cambuslang, admitted a charge of using lewd, indecent and libidinous towards the boy on 12 April this year in a wood at Bargeddie, Coatbridge.