The children were served food at a feast organised by a person at the madrassa on Tuesday afternoon, Bhiwandi's tehsildar Shashikant Gaikwad said.
The students, all boys aged around 12 to 15, complained of vomiting, nausea, stomachache and giddiness on Wednesday following which they were rushed to the government-run IGM hospital in Bhiwandi, he said.
Later, as the health of some of the children started deteriorating, all of them were shifted to the Nair Hospital in neighbouring Mumbai, he said.
Mr Gaikwad visited the children at the hospital last night and said they all were out of danger.
An investigation was on into the incident, he added.