The First Minister has spoken of her "shock and sadness" over the fatal stabbing of Bailey Gwynne as she gave an assurance over safety in Scotland's schools.

Nicola Sturgeon said the thoughts of MSPs at Holyrood were with the 16-year-old's loved ones and those affected by the tragedy.

She also stressed that incidents such as the one at Aberdeen's Cults Academy were "extremely rare in our schools" and pledged the Scottish Government would make sure that any lessons which needed to be learnt would be learnt.

The First Minister made the comments during an exchange with Kezia Dugdale at Holyrood, in which the Scottish Labour leader described the fatal incident as "every parent's worst nightmare".

Ms Sturgeon told MSPs: "May I begin today by expressing my shock and sadness at the incident which occurred yesterday at Cults Academy in Aberdeen.

"I also want to convey my deepest sympathy and condolences to the family and friends of Bailey Gwynne, who tragically died in the incident.

"While the circumstances of this young man's death are subject to ongoing and thorough police investigation, I'm sure that the whole chamber will want all those who loved Bailey, and indeed all those at the school who have been affected by this tragedy, to know that our thoughts are very much with them at this desperately sad time."

Ms Dugdale also said the thoughts and prayers of MSPs were with the teenager's family and offered support to the parents, pupils and staff at the school.

During First Minister's Questions, she said: "There are countless families across the country who will feel this pain and sorrow today.

"It's every parent's worst nightmare, sending a child off to school in the morning only for them never to return home again.

"Can the First Minister reassure parents right across the country that everything that can be done is being done to keep our children safe?"

The SNP leader replied: "Yes, indeed, of course, I can and should give that assurance."

Ms Sturgeon went on: "Incidents like this are deeply shocking and deeply tragic, and the impact on the lives of those who knew and loved Bailey Gwynne are impossible for any of us to imagine.

"Notwithstanding that, it is also important to remember and to remind ourselves that tragic incidents like this one are thankfully extremely rare in our schools. That does not, of course take away at all from the tragic nature of this incident.

"The Scottish Government will, in the fullness of time, make sure that any lessons that require to be learnt from this incident are learnt."

She added that incidents of young people possessing knives and dangerous weapons are on the decline but said it was "no reason for complacency".

Conservative leader Ruth Davidson and Scottish Liberal Democrat leader Wille Rennie also said their thoughts were with those touched by the tragedy.

Ms Davidson told MSPs: "Can I add the condolences of myself and my party to those that have already been expressed by the First Minister and the whole Parliament to the family and loved ones of Bailey Gwynne."

Mr Rennie added: "I'm sure we all appreciate the way that the community has rallied round in Aberdeen following the horrific circumstances at Cults Academy."