Children are more likely to eat healthily if unhealthy food is banned
Banning all unhealthy snacks in schools is the best way to get pupils to eat healthily, according to a study from Cardiff University.
The researchers found that peer pressure also had an impact on youngsters' healthy eating.
They say the findings highlight the need for schools to put policies in place to back up healthy eating.
But the National Association of Head Teachers (NAHT) said they do not back schemes imposing solutions on pupils.
In a year-long study, researchers from the Cardiff Institute of Society, Health and Ethics looked at the snacking habits of nine to 11 year-olds at 43 primary schools in deprived areas of south Wales and south west England.
Twenty three schools were asked to start fruit tuck shops selling a variety of fruit at a fixed price and not to sell sweets and crisps.
All the schools continued with their existing policies on bringing food into school.
Over the year-long study which was funded by the Food Standards Agency, the tuck shops sold about 70,000 pieces of fruit - or 0.06 pieces of fruit per student per day.
At the end of the year the children were surveyed on how much fruit and other snacks they had eaten the day before. They were also asked how much fruit they and their friends regularly ate at school.
The research found that fruit tuck shops alone had a limited impact on how much fruit children ate at school.
Fruit tuck shops had a greater impact if unhealthy food was banned
However, they had a much greater impact on schools which also had a "no food " or "fruit only policy".
Children who attended fruit tuck shops where fruit was the only food allowed in school ate 0.37 more portions of fruit per day than those at schools without a fruit tuck shop.
Pupils at schools which banned all types of food ate 0.14 more portions of fruit per day, the research found.
Where there were no restrictions on food being brought into school, fruit consumption was lower than at other schools, even if the school had a fruit tuck shop.
Professor Laurence Moore, from the Cardiff Institute, said: "Our results suggest that children are more willing to use fruit tuck shops and eat fruit as a snack at school if they and their friends are not allow to take in unhealthy snacks.
"This highlights the importance of friends' behaviour and of peer modelling, and of the need for schools to put policies in place to back up health interventions."
But Chris Howard, vice president of the NAHT, said while some of its members do have policies in place banning unhealthy snacks, the union did not support "solutions that impose solutions on children."
Dr Howard said: "It's up to our members to decide for themselves.
"Certainly some members in schools with older pupils find that if children can't get what they want to eat inside school, they go down the road and get it.
"There's a real problem there."