The alarm was raised just after lunchtime on Friday at Dunfermline High School in Fife, with the substances believed to have been consumed outside the grounds.
The Scottish Ambulance Service said six pupils were treated at the scene while a further four were taken to hospital.
Police said that a boy and a girl, both aged 13, have been charged in connection with the incident.
A report will be submitted to the Children’s Reporter.
In a statement on Friday a Scottish Ambulance Service spokesman said: “We received a call at 1.23pm to attend an incident at Dunfermline High School.
“We dispatched five ambulance crews, a special operations unit and a rapid response vehicle.
“We treated six patients at the scene and transported four to Victoria Hospital in Kirkcaldy.”
Fife Council urged parents to speak to their children and seek medical advice if they think they have taken tablets.
Phil Black, Fife Council’s head of education and children’s services, said: “After lunchtime, we were made aware that a small number of our pupils may have taken tablets outwith school grounds during lunchtime.
“We called emergency services immediately and have worked with them to identify and support pupils who may have been affected.”