Cognitive impairment has been identified as an important aspect of major depressive disorder (MDD). We tested two theories regarding the association between MDD and cognitive functioning using data from longitudinal cohort studies. One theory, the cognitive reserve hypothesis, suggests that higher cognitive ability in childhood decreases risk of later MDD. The second, the scarring hypothesis, instead suggests that MDD leads to persistent cognitive deficits following disorder onset. We tested both theories in the Dunedin Study, a population-representative cohort followed from birth to midlife and assessed repeatedly for both cognitive functioning and psychopathology. We also used data from the Environmental Risk Longitudinal Twin Study to test whether childhood cognitive functioning predicts future MDD risk independent of family-wide and genetic risk using a discordant twin design. Contrary to both hypotheses, we found that childhood cognitive functioning did not predict future risk of MDD, nor did study members with a past history of MDD show evidence of greater cognitive decline unless MDD was accompanied by other comorbid psychiatric conditions. Our results thus suggest that low cognitive functioning is related to comorbidity, but is neither an antecedent nor an enduring consequence of MDD. Future research may benefit from considering cognitive deficits that occur during depressive episodes from a transdiagnostic perspective.