Emergency services and specialist environmental experts raced to the scene after what is believed to be pepper spray was pumped into the gymnasium at the Reinbeker Weg School in Hamburg.
More than 30 students reported having trouble breathing as the debilitating gas also left them unable to see properly.
The fire brigade arrived with several rescue vehicles and emergency doctors, some wearing bio-hazard suits, and rushed students away from the scene.
Many pupils needed emergency care on site, with several given urgent oxygen treatment in the back of waiting ambulances.
Nine pupils are currently in hospital.
Environmental and chemical experts are trying to determine the cause of the outbreak and the exact type of gas used in the attack.
Authorties have not ruled out the possibility it may be terror related but police have said they do believe this may have been a school prank gone wrong.