The Scottish Government will not change the law to give teachers more power to search pupils following the death of schoolboy Bailey Gwynne.

Ministers were urged to consider the move by an independent review into the stabbing of the 16-year-old at Cults Academy in Aberdeen in October 2015.

Deputy First Minister John Swinney said the recommendation had been considered carefully but would not be progressed.

Pupils in Scottish schools currently have to give their consent to be searched, with police notified if it is withheld and a child or young person is suspected of carrying a weapon.

Mr Swinney told MSPs at Holyrood: "Changing the law would confer statutory powers on teachers, allowing them to compel a young person to be searched.

"Currently outside of 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 teacher/pupil relationship, which is often 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."

Mr Swinney said schools and councils already have "robust" measures in place to address violence and weapons, but refreshed guidance will be issued to reinforce the consensual search process.

He said the guidance, to be published in the spring, will also make clear that any incident "must be monitored and recorded at a local level".

Bailey's killer, a 16-year-old youth who cannot be named due to his age, was locked up for nine years in April last year after a jury found him guilty of culpable homicide and carrying weapons.

The trial at the High Court in Aberdeen heard the knife used in the stabbing had been bought online, without the killer having to prove his age.

The multi-agency review, led by child protection expert Andrew Lowe, also called on the Government to "explore the further legislative controls that can be brought to bear on the purchase of weapons online''.

In response, Mr Swinney said the impact of a change in the law in Scotland alone would be limited and UK-wide action would be more effective.

He said Scottish Justice Secretary Michael Matheson had written to Sarah Newton, the relevant UK minister, "to seek agreement to a UK-wide approach to address concerns about the online sale and delivery of knives".

Mr Swinney added: "I cannot imagine what the last year has been like for Bailey Gwynne's family but I want, on behalf of the Scottish Government, to express my heartfelt sympathies to them and to acknowledge the resilience and dignity they have shown since Bailey's death."

The decision not to increase the search powers of teachers was welcomed across the Holyrood chamber.

Tory education spokeswoman Liz Smith said: "I can accept the reasons provided by the Scottish Government as to why additional powers would not be acceptable and why they would be inconsistent with other policies.

"I think the decision will be warmly welcomed by teachers who I know had great concern about the possibility of extra powers."

She called on Mr Swinney to ensure the new guidance for schools makes it clear whose consent must be sought before any search takes place.

Labour's Claire Baker said her party also supports the Government's position.

She said: "Principally our schools must be places for learning, parents must be confident their children are safe and supported by teachers who have the relevant and proportionate powers and responsibilities to do so.

"We support all efforts to restrict the purchase of weapons online throughout the UK and support the approach that has been made to the UK Government."

Liberal Democrat MSP Liam McArthur said going down the route of statutory powers for teachers "would have run the risk of undermining confidence, trust and relationships between staff and pupils that arguably could have made school environments more difficult in terms of dealing with challenging behaviour".

Educational Institute of Scotland (EIS) general secretary Larry Flanagan 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."