Background Dispositional optimism, a personality trait characterized by generalized positive expectations towards the future, is thought to remain rather stable over time. It is however largely unknown to what extent affective disorders and its risk factors affect dispositional optimism. Methods We examined the association between (lifetime) affective disorders and childhood trauma with dispositional optimism in a sample of 2104 subjects (aged 18-65 years) from the Netherlands Study of Depression and Anxiety (NESDA). Dispositional optimism was measured with the Life Orientation Test Revised (LOT-R). Diagnoses of depressive and anxiety disorders were based on the Composite Interview diagnostic Instrument (CIDI).Childhood trauma was assessed using the Childhood Trauma Interview (CTI) and life-events with the List of Threatening Events Questionnaire (LTQ). Results The 2104 participants were on average 46.0 (SD 13.1) years old and 65.8% were female. Multivariate analyses showed that dispositional optimism was inversely associated with current affective disorders (depression: B=-1.089 and anxiety: B=-1.066, both p<0.001), but also with remitted affective disorders (depression: B=-0.822 and anxiety: B=-0.558, both p<0.001) and severity of depression (B=-4.230; p<0.001). A history of childhood emotional maltreatment (B=-0.905, p<0.001) was related to lower optimism, whilst positive life-events were associated with higher levels of optimism (B=0.235, p>0.001). Limitations The cross-sectional design hampers inferences about causality. Conclusion Lower levels of dispositional optimism are associated with stage of affective disorders, even after remission, and a history of childhood emotional maltreatment. Identification of the risk factors contributes to understand fluctuations in dispositional optimism.