More fruits and vegetables were added to school lunches. Restaurants offered smaller portions. Crosswalks even got a fresh coat of paint to encourage walking and biking.

The whole city of Somerville went on a diet to curb childhood obesity. And researchers say it worked.

Tufts University nutrition experts found public schoolchildren in this Boston suburb avoided gaining about a pound of excess weight compared with their 8-year-old counterparts in two nearby communities.

The results of the study were published last week in the journal Obesity. The report covered the first year of the 2003-04 study involving 1,696 children in first, second and third grades.

If other communities take similar steps, the findings could help children avoid becoming overweight as they grow older, said Christina Economos, who led the program called "Shape Up Somerville: Eat Smart Play Hard."

Researchers picked Somerville, a city of 77,500, because it has a large population of minority children in low-income families. Only 3 percent of the town's land is set aside for children to walk and play safely, a situation that fuels a sedentary lifestyle.

In the weeks before the study, researchers met with parents, teachers and school officials to explain the importance of avoiding meals high in fat and sugar and encouraging children to be active, Economos said.

Children began seeing fresh strawberries, raspberries, blueberries and other fruits in school cafeterias. They were told they could eat as much as they wanted. School cooks started using fresh ingredients instead of frozen foods. They also turned to olive and canola oils and replaced fried foods with baked products, including potatoes with cheese.

More than 90 teachers were taught a new health curriculum, and the program leaders learned yoga, dance and soccer to encourage children to be more active before, during and after school.

Since the study ended, the city has kept up with many of the activities and healthier eating plans.

Kayla Brown, 10, feels the difference.

"I always got tired when I walked home," said Kayla, a fourth-grader who gave up snacking on milk and cookies after school in favor of fruit or carrots and dip. "Since I have been eating more healthier foods at school, I just feel so excited, and I walk home and I never get tired."

Encouraging children to eat fresh fruits was easy. Getting them to munch on vegetable dishes was more difficult. Students were enticed to taste new foods and vote on what they would like to see on their plates.

"If it looks good, they'll take it. And if it tastes good, they'll keep eating it," school food-service director Mary Jo McLarney said.

Researchers also sent newsletters to parents and other members of the community each month offering health tips, coupons for healthy foods and updates on the project.

They also posted a physical activity guide and a healthy snack list on the city and public elementary school Web sites. Somerville school nurses were trained to keep track of students' weight gain and counsel families with a child at risk of becoming overweight.

Some businesses supported the effort. Twenty restaurants agreed to offer healthier meals — including low-fat dairy products, smaller portions, and fruits and vegetables as side dishes.

The study was funded with a $1.5 million grant from the U.S. Centers for Disease Control and Prevention. The Robert Wood Johnson Foundation also contributed a grant to make roads safer for pedestrians and cyclists.