Dietary factors and inflammation markers have been shown to play a role in the development of depression. However, there are very few studies that have explored the association between inflammatory potential of diet and risk of depression. In this study, we examined the association between the dietary inflammatory index (DII), which was developed specifically to measure the inflammatory potential of diet, and risk of depression in the middle-aged cohort of the Australian Longitudinal Study on Women’s Health. A total of 6438 women with a mean age of 52·0 (sd 1·4) years at baseline were followed-up at five surveys over 12 years (2001–2013). Depression was defined as a score of ≥10 on the Center for Epidemiologic Studies Depression-10 scale. The DII score, a literature-derived, population-based dietary index that has been validated against several inflammatory markers, was computed on the basis of dietary intake assessed using a validated FFQ. Generalised estimating equations were used to estimate relative risk (RR) of depression according to DII score. Models were adjusted for energy intake, highest education completed, marital status, menopause status and symptoms, personal illness or injury, smoking status, physical activity, BMI and depression diagnosis or treatment. In total, 1156 women (18 %) had scores≥10 on the CESD scale over the course of 9 years. Women with the most anti-inflammatory diet had an approximately 20 % lower risk of developing depression compared with women with the most pro-inflammatory diet (RRDII quartile 1 v. 4: 0·81; 95 % CI 0·69, 0·96; Ptrend=0·03). These results suggest that an anti-inflammatory diet is associated with lower risk of depression in middle-aged Australian women.