A 12-year-old boy who raped a nine-year-old girl after watching hardcore pornography on the internet has been spared jail.
The judge instead ordered him to be sent to a children's panel where he can be kept under supervision after hearing that he was "emulating adults".
Lady Smith told the boy, now 14, that he was being given a chance to "make something of yourself" but she cautioned: "You should not and must not regard pornography as any guide at all as to how to behave sexually."
However, defence counsel Sean Templeton warned that the case may be "the tip of the iceberg" and that there is a danger teenagers are watching the internet and absorbing mistaken ideas about sex.
"There is a real risk that young people of the current generation of teenagers are growing up with a skewed view of what sex is and sexual activity," he told the High Court in Edinburgh.
"This is the tip of the iceberg. Many, many cases throughout the country may not be identified, not reported, not coming to anyone's attention," said the defence counsel.
The boy, whose identity is protected by law, admitted rape and sexual assault against the girl in a Scottish island community between 1 December 2010 and 31 January 2011.
Mr Templeton added: "This was an emulation of an adult act witnessed by him at this young age. He was afforded unfettered access to the internet and it has become apparent from a very young age, the age of 12, he was accessing hardcore pornography. "The behaviour witnessed was reminiscent of the acts carried out by him,"
"The hope obviously is the behaviour can be addressed in order that he can go on to have a normal adult life."
The offences came to light when the girl complained to her mother that she had a sore stomach and asked whether it could be caused by being pregnant.
Subscribe to Independent Premium to bookmark this article
Want to bookmark your favourite articles and stories to read or reference later? Start your Independent Premium subscription today.