Wen recently visited children of migrant workers who had moved to urban areas to find work, offering them his good wishes ahead of International Children's Day, which is tomorrow.
Wen was making an inspection tour of the Wuling mountainous area in central China's Hunan province, visiting students' dorms and talking with teachers, students and their parents.
Wen offered schoolbags to students as gifts during his visit to Maoping Primary School on May 25, Xinhua news agency reported yesterday.
He offered an 8-year-old boy, Long Yingjun, a pink schoolbag, which had been handed to Wen by a staff member.
Long rejected it, saying: "I'm a boy. I don't want the color."
Wen immediately changed it for a blue schoolbag and gave it to him, saying: "Oh, I forgot you are a man!"
Long took the schoolbag and saluted Wen. Everyone at the scene was highly amused, Xinhua reported.
Online, there was much praise for the boy's bravery in speaking out in front of one of the country's top leaders.
Wen urged local authorities and schools to guarantee food safety for students, particularly those whose parents were not around to supervise their diets.
Local governments in Hunan are taking part in a national program designed to improve nutrition at rural schools, with the central government offering schools a daily subsidy of 3 yuan (about 47 US cents) per student toward purchasing nutritious food.
China's rapid industrialization has resulted in a growing number of rural "left behind" children - those whose parents have moved to urban areas to seek work.
The children are often placed in the care of relatives or friends. Hunan is home to 140,000 such children.
The premier acknowledged the contributions migrant workers are making toward boosting China's economic growth, reassuring them that their children will be well taken care of in their absence.