The force was called to reports of a “disturbance” between two boys, aged 12 and 13, at Greenock’s Lomond View Academy on Friday afternoon.
Officers who arrived on the scene used the spray after the pupils allegedly confronted them with weapons, one of which was a blade.
The boys were arrested and will be the subject of a report to the Children’s Reporter.
Inverclyde Council described it as a “serious incident” and confirmed the school remains shut today.
A Police Scotland spokesman said: “Police were called to a report of a disturbance between two pupils, aged 12 and 13, at Lomond View Academy, Greenock, around 1pm on Friday September 26.
“On arrival, and on being confronted by the two males who were at this time allegedly brandishing weapons, one of which was bladed, officers were required to deploy CS spay.
“The two boys were then arrested and detained in police custody in connection with the incident.
“A report was forwarded to the Children’s Reporter.”
It is understood the boys were released later that day.
A council spokesman said: “We can confirm that a serious incident occurred. The police are currently investigating and the council and school are supporting them.”