The role that BMI plays in the association between dietary quality and CVD risk is not known. We aimed to better understand this relationship using statistical methods which correct for sex-specific underreporting of dietary intake. Overall, dietary quality was assessed using the Healthy Eating Index (HEI) on data from 9797 non-pregnant adults (aged >20 years) who participated in the National Health and Nutrition Examination Survey from 2005 to 2010. CVD risk factors included blood pressure, fasting glucose and insulin, homeostatic models of insulin resistance (HOMA-IR), HDL- and LDL-cholesterol (HDL-C and LDL-C), TAG and C-reactive protein (CRP). We controlled for demographic and lifestyle covariates, and we used the population ratio approach (which adjusts for the underreporting of intake) to compare mean HEI scores between the top and bottom quartiles of covariate-adjusted CVD risk factors. In women, the total HEI score was not associated with any CVD risk factors (all Q>0·11). In men, the total HEI score was associated with covariate-adjusted residuals for fasting insulin (Q< 0·001), HOMA-IR (Q< 0·001), HDL-C (Q= 0·01), TAG (Q= 0·03) and CRP (Q< 0·001). When we additionally adjusted for BMI, the association with total HEI score was not significant (all P>0·10). In the present analyses, dietary quality was associated with five CVD risk factors in a sex-specific manner. Moreover, the association of BMI with CVD risk attenuated the relationship between CVD risk and diet, which suggests that BMI is an important factor in heart disease prevention.