Objective: High consumption of ultra-processed food (UPF) is associated with an increased risk of obesity, which at least partly due to the poor nutritional profile of these foods. However, little is known about the magnitude of the direct and indirect effects of UPF consumption on obesity. Thus we evaluated whether the association between UPF consumption and obesity is mediated by overall diet quality. Design and method: This study is a cross-sectional analysis of the baseline data of adults aged 30–64 years (n = 6,894) which participated in the Cardiovascular and Metabolic Diseases Etiology Research Center (CMERC) cohort study. Dietary intake was assessed by a validated 112-items food frequency questionnaire. Using the NOVA food classification, 23 FFQ items were classified as UPF. Diet quality was assessed using the Korean Healthy Eating Index (KHEI) based on the 2015 Dietary Reference Intake for Koreans. Height, weight, and waist circumference (WC) were measured and body mass index (BMI, kg/m2) was calculated. Obesity was defined as ≧ 25.0 kg/m2. Abdominal obesity was defined as ≧ 90 cm for male and ≧ 85 cm for female. Single mediation models were used to estimate the mediating effect of UPF consumption (% kcal) on obesity, after adjusting for sex, age, research center, income, education, marital status, smoking, drinking, and sitting time. All analyses were performed using SAS version 9.4. Results: UPF accounted for 17.9% of total energy intake and the mean BMI and WC was 24.1 kg/m2 and 82.3 cm. The prevalence of obesity and abdominal obesity was 35.4% and 30.2%, respectively. UPF consumption (per 10% kcal increase) was associated with higher levels of BMI (0.13 kg/m2, P < 0.001) and WC (0.39 cm, P < 0.001), and also with higher odds of obesity (OR = 1.07, 10.1–1.13) and abdominal obesity (OR = 1.10, 1.04–1.17), after adjustment for confounders. The association of UPF consumption with BMI (14.3%, 95% CI: 1.9–26.8), WC (18.1%, 95% CI: 5.3–30.8), and abdominal obesity (20.9%, 95% CI: 6.0–35.8) were partially mediated by KHEI, but the association between UPF and overall obesity was not mediated by KHEI (17.2%, 95% CI: -1.1–35.4). Conclusions: Our findings suggest that the association between UPF consumption and obesity is partially, but not all, mediated by diet quality. Although our findings have a limitation on causal inference between UPF consumption and obesity, it may help understand the mediational structure between them and seek strategies for prevention of obesity.