The pupil is said to have picked up the knife being used during a lesson at Mackie Academy in Stonehaven, Aberdeenshire.
The boy was accused of behaving in a threatening and abusive manner and subsequently charged by police.
He was later reported to the youth justice management unit.
The boy is no longer at Mackie Academy but has not been permanently excluded by the local authority.
The teacher was not physically harmed during the incident, which has emerged after 16-year-old Bailey Gwynne was fatally wounded at Cults Academy on the outskirts of Aberdeen last Wednesday.
A spokeswoman for Police Scotland said: “A 13-year-old boy was charged and reported to the youth justice management unit in relation to an incident at Mackie Academy.”
A spokeswoman for Aberdeenshire Council, which runs Mackie Academy, said it could not comment on individual cases.
The incident happened at the end of August.