Police in Scotland have brought almost 500 rape charges against children and teenagers under the age of 18 in the past five years.
Nineteen of these charges were brought against eight, nine or 10-year olds.
During the same period, three out of four specialist residential units treating sexually aggressive young people have closed.
The figures were obtained under the Freedom of Information Act as part of a BBC Scotland investigation.
A total of 755 charges were brought against under 18s for indecency or sexual offences last year.
Another case, not included in that total, involved a four-year-old in the Grampian area reported for indecent assault.
Scotland's eight police forces said that in the past five years, 490 rape charges had been brought. The figure excludes cases of consensual underage sex.
Directly comparable figures for the rest of the UK were not available, although a Youth Justice Board report paints a similar picture in England and Wales.
In 2007/8 police or courts dealt with 2,088 sexual offences by under 18s, including 244 cases involving pre-teenage children.
In Scotland the law of criminal responsibility is currently eight, compared with 10 under English law.
The BBC investigation - The Dark Side of Teenage Sex - looked at the case of teenager Colyn Evans, who murdered 16-year-old Karen Dewar in Tayport, Fife, in 2005.
Evans was accused of six sexually-related offences between the ages of 10 and 16 but he was never registered as a sex offender.
Karen Dewar's father, Frank, tells the programme the system failed both his daughter and her killer.
"Evans was never given any treatment. he was just gave up on and I suppose there are hundreds of them out there like that," he said.
If they don't get help because services have been closed, the behaviours are likely to escalate and worsen
Dr Eileen Vizard Child psychiatrist
BBC Scotland also used Freedom of Information legislation to ask Scotland's councils what treatment was being provided to sexually aggressive young people.
Most were unable to provide details on how much they spent, but it was clear only a fraction of young offenders were receiving help.
One young man, who was convicted of two counts of attempted rape carried out when he was 11 and 14, told the programme he had been sent to a specialist school which claimed it offered treatment.
He said: "No help was offered, no help was given. It was just another place for me to stay."
A recent Home Office-funded study found seven out of 10 children who carry out serious abuse had been abused themselves.
Consultant child and adolescent psychiatrist Dr Eileen Vizard, who works with the NSPCC, said early intervention was essential.
Colyn Evans had a history of sexual abuse before committing murder
"There's a great deal of evidence to show that the children who are at the highest risk start earlier in childhood - really early - ie under six or seven with worrying behaviours - that if they don't get help because services have been closed, the behaviours are likely to escalate and worsen," she said
Scottish Justice Secretary Kenny MacAskill agreed that early intervention was vital, but he said specialist treatment was available in Scotland
"We have to deal with this in a variety of ways and it's not just residential secure units," he told BBC Radio Scotland's Good Morning Scotland programme.
"We are seeking to work out and analyse what the nature of the problem is and how best to treat it. That's why we are working with specialist academics to make sure we can get to the root cause of the problem."
Mr MacAskill also said he would like to see a change in the law to allow the DNA of young sex offenders to be retained, because of evidence they often go on to commit further crimes.
The Dark Side of Teenage Sex will be shown on BBC One Scotland at 2235 BST on Tuesday.
This page is best viewed in an up-to-date web browser with style sheets (CSS) enabled. While you will be able to view the content of this page in your current browser, you will not be able to get the full visual experience. Please consider upgrading your browser software or enabling style sheets (CSS) if you are able to do so.