Executive function declines with age, but engaging in aerobic exercise may attenuate decline. One mechanism by which aerobic exercise may preserve executive function is through the up-regulation of brain-derived neurotropic factor (BDNF), which also declines with age. The present study examined BDNF as a mediator of the effects of a 1-year walking intervention on executive function in 90 older adults (mean age = 66.82). Participants were randomized to a stretching and toning control group or a moderate intensity walking intervention group. BDNF serum levels and performance on a task-switching paradigm were collected at baseline and follow-up. We found that age moderated the effect of intervention group on changes in BDNF levels, with those in the highest age quartile showing the greatest increase in BDNF after 1-year of moderate intensity walking exercise (p = 0.036). The mediation analyses revealed that BDNF mediated the effect of the intervention on task-switch accuracy, but did so as a function of age, such that exercise-induced changes in BDNF mediated the effect of exercise on task-switch performance only for individuals over the age of 71. These results demonstrate that both age and BDNF serum levels are important factors to consider when investigating the mechanisms by which exercise interventions influence cognitive outcomes, particularly in elderly populations.