The alarm was raised just after lunchtime on Friday at Dunfermline High School, with the substances believed to have been consumed outwith the grounds.
Officers are following a positive line of inquiry.
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.
“We have spoken to children this afternoon with police and paramedics to make sure anyone who has taken tablets has been identified and treated.
“We would urge parents to speak to their children to make sure that they have not taken tablets from anyone and to seek medical advice if they think they have.”
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.”