Childhood maltreatment is associated with cognitive deficits that in turn have been predictive for therapeutic outcome in psychiatric patients. However, previous studies have either investigated maltreatment associations with single cognitive domains or failed to adequately control for confounders such as depression, socioeconomic environment, and genetic predisposition. We aimed to isolate the relationship between childhood maltreatment and dysfunction in diverse cognitive domains, while estimating the contribution of potential confounders to this relationship, and to investigate gene-environment interactions. We included 547 depressive disorder and 670 healthy control participants (mean age: 34.7 years, SD = 13.2). Cognitive functioning was assessed for the domains of working memory, executive functioning, processing speed, attention, memory, and verbal intelligence using neuropsychological tests. Childhood maltreatment and parental education were assessed using self-reports, and psychiatric diagnosis was based on DSM-IV criteria. Polygenic scores for depression and for educational attainment were calculated. Multivariate analysis of cognitive domains yielded significant associations with childhood maltreatment (η²p = 0.083, P < 0.001), depression (η²p = 0.097, P < 0.001), parental education (η²p = 0.085, P < 0.001), and polygenic scores for depression (η²p = 0.021, P = 0.005) and educational attainment (η²p = 0.031, P < 0.001). Each of these associations remained significant when including all of the predictors in one model. Univariate tests revealed that maltreatment was associated with poorer performance in all cognitive domains. Thus, environmental, psychopathological, and genetic risk factors each independently affect cognition. The insights of the current study may aid in estimating the potential impact of different loci of interventions for cognitive dysfunction. Future research should investigate if customized interventions, informed by individual risk profiles and related cognitive preconditions, might enhance response to therapeutic treatments.