National clinical director Professor Jason Leitch also raised fears that families are ignoring quarantine rules and sending children back to school soon after a holiday abroad.
Headteachers around the country have been ordered to ensure youngsters and parents are made aware of the rules on self-isolation which are enforceable by law.
The move comes as cases among pupils in Glasgow and Lanarkshire continue to rise after another positive case.
Teaching unions have now stepped up calls for additional safeguards, including smaller class sizes and mandatory use of face masks among older pupils, as concerns escalate the virus could catch hold in schools across Scotland after their return last week.
Recent activity from the Scottish Government’s “Test and Protect” regime to stem the spread of the virus has also flagged up concerns about people meeting up outside schools.
“This includes parents gathering at school gates [and] young people meeting friends without following the guidance on physical distancing,” Prof Leitch told the daily coronavirus briefing yesterday.
“People are running the risk of spreading the virus to each other, their families and their loved ones.”
Anyone returning to Scotland from a foreign country, which does not have an “air bridge” with Scotland, must self-isolate for 14 days.
But Prof Leitch told the briefing: “The Scottish Government has been informed by our directors of public health about a number of cases of children and young people being in school after recently returning from countries not exempt from quarantine rules.
“The law requires that everyone returning to Scotland from non-exempt countries self-isolate at home for 14 days.
“This includes children as well as adults. People self-isolating should not go out to work, school or visit public areas.”
France, Spain and Portugal are among the countries which are not exempt and would require people to isolate.
“Scotland’s directors of education will be speaking to head teachers and heads at early learning and childcare settings today to ensure this is made clear to parents, children and young people,” Prof Leitch said.
The latest daily figures released yesterday showed there were no deaths related to Covid-19 in the past 24 hours, while the number of positive cases has risen by 26.
A total of 2,491 patients have died in Scotland with the virus, and 19,358 have tested positive.
The last confirmed death of an infected person in the country was recorded on 15 July.
It emerged yesterday that a student at Bannerman High in Baillieston that has since tested positive for Covid-19 had attended classes when the school reopened last week. Parents have been emailed to inform them of the situation, but the school remains open. Five pupils at nearby schools in North Lanarkshire have tested positive in recent days.
Several other pupils at Bannerman High had previously tested positive, but began self-isolating prior to the return to class last week.
Health officials have stressed there is no evidence to suggest these infections occurred at school, but they have raised concerns the virus is being transmitted at indoor social gatherings.
In a letter to parents, carers and pupils, NHS Greater Glasgow and Clyde said while none of the cases had been present at the school during the period in which they may be infectious to others up until now, the new case was there during this infectious period. The health board said it had undertaken a risk assessment to identify any other pupils and staff this individual had contact with during this time.
These individuals are being contacted by the Test and Protect team and told to self-isolate.
A Glasgow City Council spokeswoman said: “Public Health’s assessment is that the infection is unlikely to have occurred within the school and is linked to the Baillieston virus cluster.
“Close contacts have been notified via test and protect and will be self-isolating for the required number of days and a letter issued on Sunday night to all families, pupils and staff with updated information.”
NHS Lanarkshire is also investigating after five pupils at three different schools tested positive for the virus. These included three at St Ambrose High School in Coatbridge, one pupil from St Andrew’s High School in Coatbridge and another from Caldervale High School in Airdrie. A fifth case, who is linked to these but is not a pupil, has also been identified.
First Minister Nicola Sturgeon said: “The concern will be heightened for parents and for young people and teachers when any of the cases involve young people of school age.”
She added that many of the cases did not involve youngsters who had actually attended school and urged caution about the school connection.
“Theses are outbreaks which are being described as community outbreaks involving people who are pupils are school, not school outbreaks,” she said.
“That said, we continue to take great care in building our understanding of all of that.”
The advice surrounding the return of schools will be kept “under review”, Ms Sturgeon added.
“If there are changes that need to make around that then we do that.”
But the positive tests among pupils has again prompted the Educational Institute of Scotland (EIS) teaching union to step up calls for enhanced procedures to protect pupils and staff from potential Covid infection.
EIS general secretary Larry Flanagan said: “The cases of Covid infection that have been identified in some young people highlight the critical nature of adequate safeguards to protect pupils and staff from potential Covid infection.”