High school pupils must wear face masks between classes from Monday.
Education secretary John Swinney said pupils should be wearing coverings in areas where physical distancing is not possible, like corridors and communal areas.
He said “obligatory guidance” would be dished out to high schools for all pupils 12 or over.
Swinney added the Scottish Government is going further than the World Health Organisation (WHO) guidance by recommending face coverings on school buses.
All children aged five and over will be required to cover their faces on school transport, in line with the rules for public transport.
The full guidance will be published later on Tuesday.
Scotland’s largest teaching union the EIS has welcomed the update to guidance.
But it says more needs to be done to make physical distancing easier in schools, such as by investing in more teachers to reduce class sizes.
Swinney said: “We said that our guidance would be kept under constant review and, following updated scientific and public health advice and the experience of schools reopening, we are making changes that will apply from August 31.
“There is increasing evidence that face coverings can provide some protection for the wearer as well as those around them.
“We also know that some pupils have found it very difficult to physically distance when moving around school, which could increase the risk of transmission of the virus.
“And on school transport, as on public transport, there can be mixing between different age groups.”
He continued: “We have worked with partners on the education recovery group to update the guidance to ensure face coverings are worn in corridors and confined communal areas in secondary schools, and on school transport.
“Schools will be asked to ensure children and young people have clear instructions on how to put on, remove, and store face coverings.”
Some pupils will be exempt from wearing a face covering, whilst those who do not want to wear one are not to be excluded from school.
The deputy FM added: “Alongside this change to the wearing of face coverings, we need to reinforce the importance of maintaining high standards of cleaning, personal hand and respiratory hygiene and physical distancing, where possible.
“In situations where there is a local cluster, use of face coverings throughout the day may be required.
“The position will be kept under review to ensure that our approach remains commensurate with the evidence and the levels of transmission in Scotland.”
EIS general secretary Larry Flanagan said: “The EIS welcomes this decision by the Scottish Government today, which reflects the updated advice from the World Health Organisation recommending face coverings for those aged 12 and over, where 1m distancing cannot be maintained.
“Schools are busy places with a large number of adults and young adults moving around.
“The use of face coverings in these circumstances is a sensible and appropriate step to reduce the risk of Covid-19 spreading through school communities.”
But he added: “While we welcome today’s announcement, the EIS believes that effective physical distancing between pupils is the best means of reducing the risk of Covid-19 spread in schools.
“This is an area where the guidance from the Scottish Government currently lacks specificity; there needs to be a much sharper focus on ensuring social distancing in schools to protect pupils, staff and the wider community.
“Smaller class sizes to ensure appropriate physical distancing of pupils are essential.
“Across all sectors, smaller classes would be a huge boost, also, to the educational recovery of those pupils most disadvantaged by the impact of lockdown.
“The Scottish Government, indeed, all political parties within the Scottish Parliament, should prioritise the expenditure required for the extra teachers needed to help our pupils.”
Jo Bisset, organiser of the campaign group Us For Them Scotland which opposes mandatory masks for pupils, said the government’s decision is “a very disappointing move”.
She went on: “Parents across Scotland will be angry at this new rule.
“It will impact vulnerable pupils the most and creates another unnecessary challenge for children who’ve already endured months of misery.
“This is also a slippery slope. Today it’s over 12s in certain areas of school.
“But parents are worried that will very easily become all areas of the school, including the classroom.
“And if masks must be worn by those over 12, why not by eight and nine-year-olds?”
STV News is now on WhatsApp
Get all the latest news from around the countryFollow STV News
Follow STV News on WhatsApp
Scan the QR code on your mobile device for all the latest news from around the country