A Perth man who carried out an "opportunistic" sex attack on a two-year-old boy after reading a manual on abuse has been jailed for two years.
Ross Bayley, 28, viewed information on the dark web on "how to abuse children and get away with it."
A court heard the manual was so disturbing an experienced police analyst felt sick after viewing it.
Bayley will be monitored for five years following his release from prison.
He was also placed on the sex offenders register at the High Court in Glasgow.
The court was told that the police investigation began when the parents of a young boy contacted police after the child told them Bayley had abused him.
Officers then seized computer equipment from Bayley's home.
Prosecutor Steven Borthwick said that one of the sites Bayley visited offered "detailed and graphic advice on how to groom and sexually abuse children".
Police cybercrime examiners said the material was extensive and amounted to "a manual of how to abuse children and get away with it".
The court heard that one of the analysts with nine years experience could not continue reading as the content made him too upset and sick.
A cache of indecent images of children being sexually abused was also recovered.
Bayley admitted sexually assaulting the boy at a house in Perth on 8 June last year.
He also pleaded guilty to having indecent indecent images of children.
When police detained first offender Bayley, he told them: "I'm really, really sorry. I need help."
Defence solicitor advocate Murray Macara QC said: "I have spoken to him and he stands by his guilty plea.
"If the only charge he faced had been the indecent images, this case would not have been in the High Court."
Lady Carmichael told Bayley: "You have admitted sexually abusing a young child. This was an opportunistic attack on a young boy.
"He now has little memory of it, but it caused great distress to his immediate family.
"The social workers who prepared reports on you say you have a high risk of of sexually re-offending."