Seven of the group at Pembroke Comprehensive School fell unwell at about 14:00 BST. Police believe they experienced a poor reaction to the substance they had taken.
Some were treated at the scene while others were taken to Withybush hospital in Haverfordwest as a precaution.
None are believed to be in a life-threatening condition.
A Pembrokeshire council spokesman said parents have been informed.
A Dyfed-Powys Police spokesperson said: "At approximately 14:07 this afternoon, the ambulance service informed Dyfed-Powys Police of an incident they were dealing with at Pembroke Comprehensive School, where a group of pupils had become unwell.
"Officers attended the scene and established that a number of pupils were affected - some were treated at the scene and released, but others were conveyed to A&E in Withybush as a precaution."
The spokesperson said air ambulance also attended the school as a precaution and none of the pupils are believed to be in a life-threatening condition.
"Enquiries have commenced into the circumstances, but early indications are that the group may have reacted to a type of legal high."
Ambulance staff confirmed that they had sent four emergency ambulances to the school and an ambulance officer.
"Though the cause is yet to be confirmed, it is believed the pupils may have reacted to an unknown substance," added a spokesperson for the Welsh Ambulance Service.

A European Parliament probe alleged on Monday that funds for the group of MEPs that UKIP belongs to had wrongly been spent "for the benefit of UKIP".
It said the group should repay Â£146,696 of the funds intended for European Parliament business.
The Electoral Commission is now looking into "whether there has been any breach of UK election law".
In response to the news a UKIP spokesman said: "We are confident we will be found to be in the clear."
The European Parliament investigation claims that the UKIP-dominated grouping - the  Alliance for Direct Democracy in Europe - broke rules banning the use of the funds on "financing of national political parties, financing of national election campaigns and candidates or referendum campaigns".
In a statement the European Parliament Bureau said: "The activities of the ADDE which were found to breach the rules for European party financing, were nine opinion polls held in the UK ahead of the 2015 general elections as well as ahead of the EU referendum in 2016, and a report on these polls.
"The expenditure linked to the services of three consultants was considered non-eligible by an external auditor and by the Parliament's administration."
When the European Parliament allegations first emerged last week, a spokesman for the ADDE group accused the parliament of "harassment", with UKIP MEP Roger Helmer adding: "Call it revenge for Brexit if you like."
BBC assistant political editor Norman Smith said it was understood the Electoral Commission inquiry related to whether UKIP spent some of the European money on the Brexit referendum.
UKIP would face a possible fine up to Â£20,000 if it was judged to have accepted "impermissible donations".
A group of pupils have been treated at a Pembrokeshire school after experimenting with a 'legal high'.
[NEXT_CONCEPT]
The Electoral Commission has opened an investigation into UKIP's finances after allegations it misspent EU funds.