Objective: The age-related difference in impacts of muscle mass and fat mass on diabetes remains uncertain Methods: Total 15,586 subjects aged over 30 were included in the fourth and fifth Korea National Health and Nutrition Examination Survey with Dual Energy X-ray Absorptiometry (DXA) data. We conducted a cross-sectional study to investigate whether muscle mass and fat mass are associated with diabetes and compared the differences in association according to age. Results: In multivariate logistic regression, trunk fat/BMI was significantly associated with diabetes in men aged 70 years or more (P = 0.049). In older men with the highest quartile of trunk fat/BMI, the risk of diabetes was more than three times (odds ratio (OR) 3.116, 95% confidence interval (CI) 1.405-6.914, P = 0.005). Meanwhile, ASM/BMI showed a protective association with diabetes in men with the same age (P = 0.001). The OR in subjects with highest quartile of ASM/BMI was 0.295 (95% CI 0.157-0.554, P = 0.001). In women, highest quartile of trunk fat/BMI was significantly associated with diabetes in subjects with age 50-60 years (OR 1.891, 95% CI 1.229-2.908, P = 0.004) and subjects with age ≥ 70 years (OR 2.275, 95% CI 1.103-4.69, P = 0.026). ASM/BMI was not associated with diabetes after adjusting metabolic parameters in women. Conclusion: Fat mass was associated with the increased risk of diabetes in older men and postmenopausal women. The protective association of muscle mass with diabetes was found in older men.