A child or teacher is threatened or attacked with a weapon every other week in Scottish schools.

Eight incidents were reported to police between April 1 and June 30 this year - an average of one a fortnight.

It is the first time official statistics have been produced in Scotland.

It follows the death of 17-year-old Bailey Gwynne, who was fatally stabbed at school by fellow pupil Daniel Stroud.

Child protection expert Andrew Lowe, who led the inquiry into his death, said he was "very pleased" by the decision to record attacks.

"The numbers are relatively small but as we have learned in recent times every one is a potential fatality," he said.

"It is also the case that recorded incidents will be a small proportion of the overall incidence of this activity."

Incidents involving children younger than eight years old - the age of criminal responsibility in Scotland - are believed to have been excluded.

Police confiscated at least 18 offensive weapons between April and June, as well as another 26 items with a "blade or point".

Until now all offences involving weapons were grouped together in official reports, making it impossible to tell how many had happened in schools.

On April 1, eight new offence categories were introduced covering incidents at schools and prisons.

A spokesman for the Educational Institute of Scotland (EIS), which represents teachers, said: "While incidents of this type remain very rare in our schools, clearly there is no justification for a pupil ever to bring a weapon into school.

"Many incidents of weapon carrying are cases of foolish bravado, where pupils are seeking to impress others, but they are nonetheless a significant threat to the health and safety of school staff and pupils."

EIS strongly rejected a recommendation that teachers should be given powers to search children suspected of carrying weapons following Bailey Gwynne's death.

An investigation by STV News revealed hundreds of children had been excluded from Scottish schools for attacks.

It also found police were not told about every incident and that schools were widely misreporting attacks.

A spokesman for the Scottish Government said it was working with councils to tackle crime in schools.