Police Scotland said officers were called to the school on Monday in the north Aberdeenshire area.
The school has not been identified.
Inspector Kevin Goldie said: “Police received a report of an incident of a young boy taking a knife into school.
“Officers attended and a nine-year-old boy has been charged.”
A report will be submitted to the Youth Justice Management Unit.
An Aberdeenshire Council spokesperson said: “We can confirm that a pupil at a school has been charged by police following an incident.
“As there is a live police investigation into this incident, it would be inappropriate for us to comment further.”
Parents at the affected school have been informed.