The number of children reported to prosecutors for sexual offences has risen by 21% in four years, new figures have revealed.
There was also a 34% rise in the number of children being reported as the perpetrators of sexual offences where the victim was another child.
Sexting – sharing intimate images – is one reason for the increase.
Leading prosecutors said the figures show the need for better education of young people.
Alison Di Rollo, the solicitor general, is to host a summit in Glasgow on Friday, to help professionals prevent future sexual offending by children.
She said: “Too many children and young people are coming to the attention of the police and the prosecution service in relation to sexual offending.
“There is a growing body of evidence that indicates that the most significant factor in determining whether a child will commit criminal offences in the future is contact with the criminal justice system at a young age.
“I don’t want to prosecute Scotland’s young people, nor do I want them to have to give evidence in court against their peers and I believe that the one of the key ways that we can protect our children and young people is by educating them about the law.”
COPFS figures showed that between 2011/12 and 2015/16 the number of people aged 17 or under accused of sexual offending rose from 350 to 422, an increase of 21%.
There were 1,600 victims of sexual offending in that age group, a rise of 34%, while there was a similar rise in the number of children accused of a sexual offence against another child.
The children’s charity NSPCC said “sexting” was a major problem for young people who were often ignorant of the law.
NSPCC Scotland’s public affairs manager, Joanna Barrett, said: “How much do young people know about sexting, that it’s a crime, and prosecutable?
“Education in sexual health and relationships is patchy across Scotland, and education about sexting needs to be part of what is provided.”
The Scottish government published details in August 2017 of a review of the way personal and social education is taught in schools.
Deputy First Minister John Swinney said the government would work with COPFS to reduce the numbers of young people brought before the courts on sexual offence charges.
He said: “It is important that children and young people gain knowledge about the laws on sexual behaviour which is appropriate to their age and stage of education. The approach delivered through the Curriculum for Excellence supports this.”
COPFS said there were a number of offences relevant to young people and sexual offending.
They include “revenge porn” – posting intimate images of somebody without their consent. This is a new law, which came into effect in 2017, and which is not reflected in the figures published at the conference.
Prosecutors said “sexting” and other types of sexual communications can be criminal either because the person receiving the communication does not consent, or because they are aged under 16.
Other sexual offences which could involve young people include having sexual intercourse with someone under 16, and where two people are aged between 13 and 15 engage in sexual conduct including oral sex.