Background To examine the relation between inflammatory potential of diet and incident knee osteoarthritis (OA) and the role of BMI in the association of interest. Methods In the Osteoarthritis Initiative, the energy-adjusted dietary inflammatory index (E-DIITM) scores were calculated based on the Block Brief 2000 Food Frequency Questionnaire and categorized into sex-specific quartiles. Outcomes were incident: (1) radiographic knee OA (ROA) (i.e., a KL grade ≥2), (2) symptomatic knee OA (SxOA) (i.e., a combination of a frequent knee pain and ROA). We fitted generalized estimating equation models to examine the association between E-DII scores and incident knee OA. We performed mediation analyses to assess potential mediation by BMI in the DII-OA relation. Results Over a 48-month follow-up period, 232 and 978 knees developed ROA and SxOA, respectively. Compared with the lowest (most anti-inflammatory) E-DII quartile, the odds ratio (OR) of incident ROA for the highest (most pro-inflammatory) E-DII quartile was 1.73 (95% confidence interval (CI): 1.15 to 2.62, Ptrend= 0.007). The corresponding OR for SxOA was 1.43 (95% CI: 1.16 to 1.76, Ptrend = 0.001). The DII-OA association was significantly mediated via BMI with an indirect effect of 1.08 (95% CI: 1.04,1.13) for ROA and 1.13 (95% CI: 1.09, 1.16) for SxOA, accounting for 20.4% and 44.5% of total effect, respectively. Conclusions A higher inflammatory potential of diet increased the risk of knee OA. The association was significantly mediated via BMI. Targeting inflammatory potential of diet may be beneficial to reduce risk of knee OA.