The children started falling violently ill soon after they ate the free school lunch of rice, lentils, soybeans and potatoes.
The food, part of a programme that gives poor Indian students at least one hot meal a day, was tainted with insecticide, and soon 25 of the students were dead and dozens were hospitalised, officials said Wednesday.
It was not immediately clear how chemicals ended up in the food at the school in the eastern state of Bihar. One official said that the food may not have been properly washed before it was cooked.
The children, between the ages of 5 and 12, got sick soon after eating lunch Tuesday (local time) in Gandamal village in Masrakh block, 80 kilometres north of the state capital of Patna. School authorities immediately stopped serving the meal as the children started vomiting.
Savita, a 12-year-old student who uses only one name, said she had a stomach ache after eating soybeans and potatoes and started vomiting.
''I don't know what happened after that,'' Savita said in an interview at Patna Medical College Hospital, where she and many other children were recovering.
The lunch was cooked in the school kitchen.
The children were rushed to a local hospital and later to Patna for treatment, said state official Abhijit Sinha.
In addition to the 25 children who died, about two dozen more and the school cook were in hospital undergoing treatment, said PK. Sahi, the state education minister.
Authorities suspended an official in charge of the free meal scheme in the school and registered a case of criminal negligence against the school headmistress, who fled as soon as the children fell ill.
Angry villagers, joined by members of local opposition parties, closed shops and businesses near the school and overturned and burned four police vehicles.
Sahi said a preliminary investigation suggested the food contained an organophosphate used as an insecticide on rice and wheat crops. It's believed the grain was not washed before it was served at the school, he said.
However, local villagers said the problem appeared to be with a side dish of soybeans and potatoes, not grain. Children who had not eaten that dish were fine, although they had eaten the rice and lentils, several villagers said.
Sinha said the cooked food and kitchen utensils have been seized by investigators.
''Whether it was a case of negligence or was intentional, we will only know once the inquiry has been conducted,'' he said.
India's midday meal scheme is one of the world's biggest school nutrition programmes. State governments have the freedom to decide on menus and timings of the meals, depending on local conditions and availability of food rations.
It was first introduced in southern India, where it was seen as an incentive for poor parents to send their children to school.
Since then the programme has been replicated across the country, covering some 120 million school children.
It's part of an effort to address concerns about malnutrition, which the government says nearly half of all Indian children suffer from.
Although there have been occasional complaints about the quality of the food served, or the lack of hygiene, the tragedy in Bihar appeared to be unprecedented for the massive food programme.