Almost 40% of children's diets come from unhealthy fats and added sugars.
The research team - led by Katy Purtell, assistant professor of human sciences at Ohio State University - found that the higher the frequency of fast-food consumption in fifth grade, the worse children performed on math, reading and science tests in eighth grade.
They published their findings in the journal Clinical Pediatrics in December 2014.
Many studies have suggested that consumption of unhealthy foods is a major contributor to childhood obesity, while health experts believe junk food drives increasing rates of diabetes, high blood pressure and stroke.
There has been much debate over the marketing of junk food to children, with many experts claiming it encourages unhealthy eating.
According to the Prevention Institute, almost 40% of children's diets come from unhealthy fats and added sugars, and only 21% of youths aged 6-19 years eat the recommended five portions of fruits and vegetables a day.
In this study, Purtell and her team wanted to determine whether fast-food consumption affects how well a child does in school.
The researchers analyzed data from 11,740 students who were part of the Early Childhood Longitudinal Study-Kindergarten Cohort. All students were in kindergarten in the 1998-99 school year.
When the children were in fifth grade, they completed a food consumption questionnaire. From this, the team found that only 29% of children reported eating no fast food in the week prior to the questionnaire.
Test scores up to 20% lower among children who ate fast food
Around 10% of children reported eating fast food every day, while 10% reported eating it four to six times a week. The remaining children reported eating fast food one to three times in the week before the questionnaire.
The children completed tests in reading, math and science in fifth grade, and further tests in these three subjects were completed when they reached eighth grade.
The study results revealed that children who consumed fast food four to six times a week or every day scored up to 20% lower on math, reading and science tests in eighth grade than those who did not eat any fast food. Children who ate fast food one to three times a week had lower scores on the math test only in eighth grade, compared with those who ate no fast food.
The researchers say their results remained even after accounting for other potential contributing factors for lower test scores, such as exercise, television viewing time, their family's socioeconomic status, other food consumption, and school and neighborhood characteristics.
Commenting on the team's findings, Purtell said:
"There's a lot of evidence that fast-food consumption is linked to childhood obesity, but the problems don't end there. Relying too much on fast food could hurt how well children do in the classroom.
We're not saying that parents should never feed their children fast food, but these results suggest fast-food consumption should be limited as much as possible."
Although the researchers say they are unable to say exactly why fast-food consumption in fifth grade appeared to affect test scores in eighth grade, they note that other studies have indicated that fast food lacks nutrients associated with cognitive development, such as iron.
Furthermore, they say that previous research has linked high-fat and high-sugar diets to impaired memory and learning skills.
Earlier this month, Medical News Today reported on a study claiming children born with a low birth weight may have poorer academic outcomes than heavier newborns.