Children who participated in a physical activity program after school did better on thinking tasks than kids who didn’t take part in the program, according to a new study.

Participants in the nine-month program performed better on tasks that tested their abilities to block out distractions, focus and multitask, said Charles H. Hillman, the study’s lead author from the Department of Kinesiology and Community Health at the University of Illinois at Urbana-Champaign.

Those skills, he added, are needed by people throughout their lives.

“Kids and adults do these things all the time,” said Hillman.

Additionally, the findings suggest that physical activity has a direct effect on brain health. If that's true, then cutting back on physically active times of the day like recess may have unintended consequences, the researchers write in the journal Pediatrics.

Previous research has found that inactivity affects adults' brain health, but there have been few studies to test the connection between inactivity and brain health among children, the researchers write.

The brain goes through extensive changes and development during childhood. An active lifestyle during those years may protect brain health throughout life, the researchers add.

For the study, Hillman and his colleagues randomly assigned 221 kids in Illinois to a waitlist or an after-school program called FITKids, which was offered on 150 days of the school year. The children were all between seven and nine years old.

The FITKids program includes two hours of physical activity per session, with at least 70 minutes of moderate to vigorous physical activity at "activity stations," followed by a snack and rest, and ending with another 45 minutes of organizational games centered on a skill, like soccer or tag.

Current guidelines in the U.S. and Europe recommend at least 60 minutes of moderate to vigorous physical activity per day for kids and teens.

Both the FITKids group and the waitlist group improved in fitness over the nine-month period, but the FITKids group improved more, with a 6 percent increase in aerobic ability, compared to 1 percent among the waitlist group.

On cognitive tasks, the physical activity group improved in accuracy more than the waitlist group. They also improved more in multi-tasking than the waitlist group.

Based on before-and-after studies of electrical activity in kids' brains, only the FITKids group increased the amount of attention they gave to tasks by the end of the study.

Kids in the FITKids group attended an average of 80 percent of the sessions through the school year. Their performances tended to increase along with their attendance in the program, the researchers found.

“We had some evidence that exercise programs could help children with their cognition, but now we have a result that it helps with cognitive flexibility too,” said Catherine L. Davis.

Davis, a professor of pediatrics, physiology and graduate studies at Georgia Regents University in Augusta, was not involved in the new study.

While there are many theories about how physical activity may improve brain health, Davis said there is no one answer so far.

The researchers can’t say physical activity by itself led to the improved brain health, because the participants may have benefited from interacting with other children and general education from the program.

Sports keep heart rates up and simultaneously test the brain in a unique way. In some sports, for example, the brain must predict where the ball is going and where teammates will be, Davis told Reuters Health.

“Kids need to be physically active about an hour per day,” Hillman said.

Parents who don’t have access to an after-school program like the one in the study could take their kids to a park or the YMCA, Hillman said, or some other safe environment where the kids can be physically active.