Objective: This study aimed to analyze the factors affecting depression among South Korean middle-aged and older adults using data from the Korean Longitudinal Study of Aging. Methods: We analyzed data regarding demographic characteristics, lifestyle, quality of life, cognitive level, and depression. Cognitive level and depression were evaluated using the Korean-Mini-Mental Status Examination and Center for Epidemiological Studies Depression Scale, respectively. Results: Depression was correlated with age, gender, residential area, level of education, alcohol intake, regular exercise, life satisfaction, and cognitive level, but not smoking. Furthermore, depression was highly affected by age, residential area, regular exercise, life satisfaction, and cognitive level, with a prediction accuracy of 80.26% achieved through machine learning analysis. Conclusions: Various factors are associated with depression in middle-aged and older adults. Therefore, multifaceted interventions for preventing depression in these age groups are required.