Encourage young boys and girls to run, jump, squeal, hop and chase after each other or after erratically kicked balls, and you substantially improve their ability to think, according to the most ambitious study ever conducted of physical activity and cognitive performance in children. The results underscore, yet again, the importance of physical activity for children’s brain health and development, especially in terms of the particular thinking skills that most affect academic performance.

The news that children think better if they move is hardly new. Recent studies have shown that children’s scores on math and reading tests rise if they go for a walk beforehand, even if the children are overweight and unfit. Other studies have found correlations between children’s aerobic fitness and their brain structure, with areas of the brain devoted to thinking and learning being generally larger among youngsters who are more fit.

But these studies were short-term or associational, meaning that they could not tease out whether fitness had actually changed the children’s’ brains or if children with well-developed brains just liked exercise.

So for the new study, which was published in September in Pediatrics, researchers at the University of Illinois at Urbana-Champaign approached school administrators at public elementary schools in the surrounding communities and asked if they could recruit the school’s 8- and 9-year-old students for an after-school exercise program.

This group was of particular interest to the researchers because previous studies had determined that at that age, children typically experience a leap in their brain’s so-called executive functioning, which is the ability to impose order on your thinking. Executive functions help to control mental multitasking, maintain concentration, and inhibit inappropriate responses to mental stimuli.

Children whose executive functions are stunted tend to have academic problems in school, while children with well-developed executive functions usually do well.

They received commitments from 220 local youngsters and brought all of them to the university for a series of tests to measure their aerobic fitness and current executive functioning.

The researchers then divided the group in half, with 110 of the children joining a wait list for the after-school program, meaning that they would continue with their normal lives and serve as a control group.

The other 110 boys and girls began being bused every afternoon to the university campus, where they participated in organized, structured bouts of what amounted to wild, childish fun.

“We wanted them to play,” said Charles Hillman, a professor of kinesiology and community health at the University of Illinois who led the study.

Wearing heart rate monitors and pedometers for monitoring purposes, the children were guided through exercise that doubled as romping. The activities, which changed frequently, consisted of games like tag, as well as instruction in technique skills, such as how to dribble a soccer ball. The exercise curriculum was designed to improve both aerobic endurance and basic motor skills, Dr. Hillman said.

Each two-hour session also included downtime, since children naturally career about and then collapse, before repeating the process. In total, the boys and girls generally moved at a moderate or vigorous intensity for about 70 minutes and covered more than two miles per session, according to their pedometers.

The program lasted for a full school year, with sessions available every day after school for nine months, although not every child attended every session.

At the end of the program, both groups returned to the university to repeat the physical and cognitive tests.

As would have been expected, the children in the exercise group were now more physically fit than they had been before, while children in the control group were not. The active children also had lost body fat, although changes in weight and body composition were not the focus of this study.

More important, the children in the exercise group also displayed substantial improvements in their scores on each of the computer-based tests of executive function. They were better at “attentional inhibition,” which is the ability to block out irrelevant information and concentrate on the task at hand, than they had been at the start of the program, and had heightened abilities to toggle between cognitive tasks.

Tellingly, the children who had attended the most exercise sessions showed the greatest improvements in their cognitive scores.

Meanwhile, the children in the control group also raised their test scores, but to a much smaller extent. In effect, both groups’ brains were developing, but the process was more rapid and expansive in the children who ran and played.

“The message is, get kids to be physically active” for the sake of their brains, as well as their health, Dr. Hillman said. After-school programs like the one he and his colleagues developed require little additional equipment or expense for most schools, he said, although a qualified physical education instructor should be involved, he added.

Extended physical education classes during school hours could also ensure that children engage in sufficient physical activity for brain health, of course. But school districts nationwide are shortening or eliminating P.E. programs for budgetary and other reasons, a practice that is likely “shortsighted,” Dr. Hillman said. If you want young students to do well in reading and math, make sure that they also move.

A version of this article appears in print on 10/14/2014, on page D4 of the NewYork edition with the headline: A Brain Tonic for Children.