Teachers will not be given the power to search pupils suspected of carrying weapons without their consent, the education secretary has announced.

An independent report into the circumstances of the fatal stabbing of Bailey Gwynne at Cults Academy in Aberdeen recommended the Scottish Government change the law to give more search powers to pupils.

Teachers can ask to search pupils if they suspect a weapon is being carried but the pupil can refuse to be searched.

John Swinney told MSPs on Tuesday that changing the law would be the wrong move.

The education secretary said: "Schools and local authorities in Scotland already have robust processes in place to address concerns about violence and weapons.

"These take into account health and safety issues and are based on risk assessments which enable staff to deal appropriately with situations where a weapon is suspected.

"In such circumstances, 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."

He continued: "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."

Swinney added: "We will continue with the current approach, while strengthening and clarifying the position in our refreshed guidance on school exclusions.

"The guidance will be clear that consensual searches can continue but if a teacher is uncertain or a young person will not cooperate by showing their belongings, then the Police must be called immediately."

Scotland's largest teaching union, the Educational Institute of Scotland (EIS), welcomed the announcement.

The union's general secretary 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."

The review also recommended "the Scottish Government should explore the further legislative controls that can be brought to bear on the purchase of weapons online".

Bailey's killer bought the knife used in the attack on Amazon and told detectives he purchased it online as "they don't check if you're over 18". It is illegal to sell knives to under-18s in Scotland.

Amazon and eBay pledged to introduce tougher age checks for online knife sales but an investigation by STV News last year uncovered these were not being enforced.

Swinney conceded he could "act to change the law in Scotland on the purchase of knives" but its impact would be "limited" due to other parts of the UK not having the same law.

He said: "The most effective way to ensure more robust controls are in place would be through UK wide action."