ABSTRACT OBJECTIVES To explore the association between adiposity, major depressive disorder and generalized anxiety disorder, and to assess the role of inflammation, diet quality and physical activity in this association. METHODS We used data from 2,977 individuals from the 1993 Pelotas Cohort (Brazil) who attended the 18- and 22-year follow-ups. We assessed general obesity using body mass index, fat mass index, and abdominal obesity using waist circumference. Major Depressive Disorder and generalized anxiety disorder were assessed using the mini-international neuropsychiatric interview. C-reactive protein and interleukin-6 (IL-6) levels were used as a measure of inflammation; diet quality was estimated using the revised diet quality index, and physical activity was assessed by the International physical activity questionnaire (IPAQ, min/day). The association between adiposity and major depressive disorder and generalized anxiety disorder was assessed using logistic regression, and the natural indirect effect via the mediators was estimated using G-computation. RESULTS General obesity assessed by body mass index (OR: 2.3; 95% CI:1.13; 4.85), fat mass index (OR: 2.6; 95%CI: 1.37; 4.83), and abdominal obesity (OR: 2.5; 95%CI: 1.18; 5.39) were associated with higher odds of major depressive disorder, whereas major depressive disorder was only associated with obesity assessed by body mass index (OR=1.9; 95% CI: 1.09; 3.46). Obesity and generalized anxiety disorder were not associated. C-reactive protein, diet quality and physical activity did not mediate the effect of obesity on major depressive disorder, and C-reactive protein mediated about 25% of the effect of major depressive disorder on adiposity. CONCLUSIONS Depression, but not generalized anxiety disorder, is associated with adiposity in both directions, with a stronger evidence for the direction obesity-depression. Inflammation explains part of the effect of major depressive disorder on obesity but not the other way around. Further research should explore other mechanisms that could be involved in the association between obesity and depression.