Recent studies suggest an association between greater dietary inflammatory index (DII) and higher biological ageing. As α-Klotho has been considered as a longevity protein, we examined whether α-Klotho plays a role in the association between DII and ageing. We included 3054 participants from the National Health and Nutrition Examination Survey. The associations of DII with biological and phenotypic age were assessed by multivariable linear regression, and the mediating role of α-Klotho was evaluated by mediation analyses. Participants’ mean age was 58·0 years (sd 11·0), with a median DII score of 1·85 and interquartile range from 0·44 to 2·79. After adjusting for age, sex, race/ethnicity, BMI, education, marital status, poverty income ratio, serum cotinine, alcohol, physical activity, a higher DII was associated with both older biological age and phenotypic age, with per DII score increment being associated with a 1·01-year increase in biological age (1·01 (95 % CI: 1·005, 1·02)) and 1·01-year increase in phenotypic age (1·01 (1·001, 1·02)). Negative associations of DII with α-Klotho (β = –1·01 pg/ml, 95 % CI: –1·02, –1·006) and α-Klotho with biological age (β= –1·07 years, 95 % CI: –1·13, –1·02) and phenotypic age (β= –1·03 years, 95 % CI: –1·05, –1·01) were found. Furthermore, α-Klotho mediated 10·13 % (P < 0·001) and 9·61 % (P < 0·001) of the association of DII with biological and phenotypic age, respectively. Higher DII was associated with older biological and phenotypic age, and the potential detrimental effects could be partly mediated through α-Klotho.