It was not immediately clear how chemicals ended up in the food in a school in the eastern state of Bihar. One official said the food may not have been properly washed before it was cooked.
The children, between the ages of 5 and 12, fell ill Tuesday soon after eating lunch in Gandamal village in Masrakh block, 80 kilometers (50 miles) north of the state capital of Patna. School authorities immediately stopped serving the meal of rice, lentils, soybeans and potatoes 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, part of a popular national campaign to give at least one daily hot meal to children from poor families, 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 22 children who died, another 25 children and the school cook were in hospital undergoing treatment, P.K. Sahi, the state education minister. Three children were in serious condition.
Authorities suspended an official in charge of the free meal scheme in the school and registered a case of criminal negligence against the school headmaster, 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 told the AP.
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 programs. 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 program has been replicated across the country, covering some 120 million school children. It's as 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 program.