Children with attention deficit problems make bigger academic gains if they are taking stimulant medications compared to similar kids who aren’t receiving drug therapy, a new study shows.

The findings, from a five year study of nearly 600 schoolchildren from across the country, are believed to be the first to offer an objective measure of the effect of drug therapy on a child’s long-term academic achievement. Earlier studies have shown that children who receive medication for attention-deficit hyperactivity disorder behave better in class and can complete more homework. But it hasn’t been clear whether treating A.D.H.D. results in any measurable improvement in long-term academic gains.

The latest study, conducted by researchers at the University of California, Berkeley, and published in Pediatrics, tracked standardized math and reading scores among a nationally-representative sample of 600 children from kindergarten through the fifth grade, all of whom had been diagnosed with A.D.H.D. The researchers compared the scores of the students who were on A.D.H.D. medications with similarly diagnosed students who weren’t receiving drug therapy. In the study, taking A.D.H.D. medication was associated with gains in math scores that equated to about a fifth of a school year in extra learning. In reading, the gains were even greater, equating to progress of about a third of a school year.

“I think the findings are important because this is the first time that we’ve had objective educational performance measures, to look at whether kids who are taking medications for A.D.H.D. compared to kids who are not, that actually show that they are doing better,” said Richard Scheffler, distinguished professor of health economics and public policy at the University of California, Berkeley’s School of Public Health. “There are 4.4 million A.D.H.D. kids, so this is a huge improvement quantitatively in their school year.”

While the study is not a randomized trial measuring the effect of drug treatment versus a placebo, the researchers said the association between medication and academic gains is strong. The study controlled for numerous variables, such as parent’s educational level and other changes that could have influenced test scores. However, A.D.H.D. medication could be a proxy for some other factor influencing a child’s academic performance. For instance, it may be that children whose parents seek out drug therapy for A.D.H.D. are more accepting of the condition and more involved in helping the child achieve at school.

The researchers also noted that medication may not be an option for some children who experience side effects like loss of appetite or sleep problems. A broad approach that includes doctors, parents and school officials is needed to help kids with A.D.H.D. close the educational gap, they said.

“Medications may not be right for every kid,” Dr. Scheffler said. “But you need to treat A.D.H.D. as a team sport that includes heavy parent involvement, particularly at young ages, and school involvement with individual tutoring and organizational help.”