In an effort to curb rising child obesity rates, many states across the US have limited the unhealthy foods that kids can buy at school -- and new evidence shows it could be paying off.

Researchers followed more than 6,000 fifth and eighth-grade students in 40 states and found those who lived in states with so-called "competitive food laws" had a better handle on their weight as they got older.

The laws strive to keep junk food and sugary drinks out of school snack bars and vending machines, and also cover foods sold a la carte in the cafeteria and edibles sold in fundraising projects for school teams or organizations.

The new study indicates that students in states with such laws gained less weight over time and were less likely to remain overweight or obese compared to kids who went to school in states without the laws.

"Competitive food rules are incredibly important," concluded Dr. Marlene Schwartz, deputy director of the Rudd Center for Food Policy and Obesity at Yale University. "We have found that kids eat less junk food when there is less junk food in schools."

More From TSM Interactive