"I pray that those injured in the accident in Etah recover at the earliest," the Prime Minister added.
Officials say the JS Vidyaniketan School had called students to attend classes, despite the district magistrate's orders to keep all schools closed due to the intense cold.
Orders have now been issued to cancel the registration of the school.
The district magistrate said that 12 of those killed have been identified and the children were in the five to 15 age bracket.
Police say the truck that was involved in the accident was loaded with sand and was speeding, according to news agency Associated Press. Another officer said the truck driver had suffered serious injuries and his legs had to be amputated in hospital.
Soon after getting the news of the accident, officials rushed to the spot and supervised rescue and relief operations.
Uttar Pradesh Governor Ram Naik and Chief Minister Akhilesh Yadav also condoled the death of the children. Mr Yadav also asked officials to ensure proper treatment of the injured.
With inputs from PTI