Young people get more information about sex in school lessons than they do from their friends or parents, according to research by Edinburgh University.
About half of 15-year-old boys and a third of girls said school was the place they learned most about sexual matters.
The study showed a change since 2002, when youngsters said they got most information from friends.
The survey was carried out in 300 schools across Scotland.
The survey also revealed that young people who reported school as their main source of information were less likely to have had sex than those who said they got their information from their parents or friends.
Less than one-fifth of boys, 18%, and one quarter of girls, 23%, who reported getting their information from school have had sex.
This compared with two-fifths of boys and girls, 41% and 43% respectively, who got their information from friends.
Only a small proportion of young people reported TV or radio, books, doctors or family planning clinics as their main source of information.
The study also found that pupils who received sex education were less likely to have negative views about condoms than those who had not received sex education.
Researcher Jo Kirby, of the University of Edinburgh's child and adolescent health research unit, said: "This paper highlights the impact of the increasing prevalence of information provided about sexual matters to young people at school.
"Improving teacher-pupil communication about sexual matters may further increase the benefits associated with sex education in schools."
The research is part of a wider Health Behaviour in School-aged Children (HBSC) study, an international survey by the World Health Organisation involving more than 40 countries in Europe and North America.