The Scottish government is to push for a UK-wide crackdown on the sale of knives online after the death of Aberdeen schoolboy Bailey Gwynne.
Bailey, 16, was stabbed during a fight with a fellow pupil at Cults Academy.
His killer is serving nine years for culpable homicide.
A review of the death made a series of recommendations, one of which was for the government to seek "further legislative controls" on the sale of weapons online.
Education Secretary John Swinney confirmed the government would be taking this recommendation forward, and had contracted the UK government to seek a "UK-wide approach".
However, he rejected another recommendation to give teachers a statutory power to search pupils without permission. Mr Swinney said this would "place teachers on the same footing as police officers" and "radically change the pupil-teacher relationship".
The Educational Institute of Scotland (EIS) has welcomed the announcement.
The review, by child welfare professional Andrew Lowe, made 21 recommendations.
The review found the pupil's death was "potentially avoidable" and said the Scottish government should consider legal changes to give teachers more power to search pupils and to crack down on online knife sales.
It said the stabbing was "an unplanned, spontaneous conflict that emerged rapidly out of unexceptional banter".
Mr Swinney told MSPs that he wanted to "express my heartfelt sympathies" to the teenager's family and to "acknowledge the resilience and dignity they have shown since Bailey's death".
He said the death was "a shocking and tragic incident"; "an unplanned and spontaneous conflict from which we must learn, to minimise the risk of it happening to other children and young people".
The education secretary said the recommendation about online weapon sales would be taken forward, but that the other about teacher searches would not.
He said: "We can act to change the law in Scotland on the purchase of knives. But as the purchase and delivery of knives crosses the borders of all UK countries, it is clear that the impact of a change only in Scotland would be limited.
"The most effective way to ensure more robust controls are in place would be through UK-wide action.
"Accordingly, the cabinet secretary for justice has written to Sarah Newton MP, the UK's minister for vulnerability, safeguarding and countering extremism, to seek agreement to a UK-wide approach to address concerns about the online sale and delivery of knives."
In response to the other recommendation, Mr Swinney said the government would "include new guidance on violence and weapons in schools within our refreshed guidance on school exclusions" in the Spring.
But he said after "very careful consideration", teachers would not be given the power to search pupils without permission.
He said: "Schools and local authorities in Scotland already have robust processes in place to address concerns about violence and weapons.
"Teachers may ask to carry out a consensual search. Changing the law would confer statutory powers on teachers, allowing them to compel a young person to be searched. Currently, outside the prison system, this power is held only by the police - we would therefore be placing teachers on the same footing as police officers if we were to change the law.
"This would radically change the pupil/teacher relationship - which is fundamental to encouraging young people to change challenging behaviour - and, potentially, damage the school ethos and commitment to positive relationships that currently exists in Scottish schools."
A spokesman for Aberdeen City Council said they would "continue to work closely with all partners to progress with the implementation of the recommendations" from the report.
EIS general secretary Larry Flanagan said it was "absolutely right that a major independent review" was carried out, and welcomed that the government had taken time to deliver "an appropriately measured response".
He said: "The EIS believes that the Scottish Government has taken the correct view in ruling out statutory powers to enable searching of pupils without parental support. Experience from England, where teachers have such power, does not suggest that it is a crucial area of intervention.
"Instead the focus should continue to be on building positive relationships in schools, creating an atmosphere of trust so that students can report concerns to staff, and ensuring that students are aware of the dangers associated with carrying weapons."
Conservative education spokeswoman Liz Smith said she accepted the government's reasons for opposing compulsory searches, but asked for guidance on consensual searches to be made clearer.
Labour's Claire Baker welcomed the review and the work of Aberdeen City Council, saying "parents must know their children are safe in school".
Lib Dem Liam McArthur also welcomed the decision on searches, saying a change in the law would have damaged confidence in schools.
Green MSP Ross Greer echoed this, saying the "trust between pupils and teachers" was "essential" in keeping schools as safe as possible.