The aim of this study was to assess the sleep status of middle-aged and elderly adults in Bengbu City, Anhui Province, China, to identify the major dietary patterns, and to analyze the association of different sleep duration and dietary patterns with metabolic syndrome (MetS) and its related influencing factors, as well as to explore the predictive value of sleep duration and dietary patterns. A cross-sectional analysis was performed utilizing data collected from the Community-based Cardiovascular and Health Promotion Study 2019 (COCHPS 2019) conducted in Bengbu. The definition of MetS adhered to the criteria of Guidelines for the Prevention and Treatment of Dyslipidemia in Chinese Adults (2016 Revision). Dietary information was obtained using the Food Frequency Questionnaire (FFQ) to assess dietary intake over the past year. Principal component analysis (PCA) was performed to identify dominant dietary patterns. A logistic regression model was developed to analyze the associations among sleep duration, dietary patterns, and MetS, and a decision tree (DT) model was developed to compare factors affecting MetS and screen people at high risk for MetS. The prevalence of MetS was 13.4% among the 9132 middle-aged and elderly residents over 45 years of age included in COCHPS 2019. Participants were divided into short (< 6 h/d), normal (6–8 h/d), and long (> 8 h/d) groups based on their daily sleep duration. Three dietary patterns were identified by PCA, the fruit-milk pattern, the tubers-meat pattern, and the vegetable-cereal pattern. After adjusting for covariables, logistic regression analysis showed that long sleep duration was significantly negatively associated with MetS. The fruit-milk and vegetable-cereal patterns were negatively associated with MetS, whereas the tubers-meat pattern was positively correlated with MetS. The results of the DT model analysis showed that the vegetable-cereal pattern is the most important factor impacting MetS, followed by marital status, the tubers-meat pattern, the fruit-milk pattern, exercise, sleep duration, and gender. The DT model also screened out five types of MetS high-risk groups. The results of our study indicate that normal sleep duration and consumption of either a fruit-milk or vegetable-cereal diet may lower the likelihood of developing MetS in middle-aged and elderly adults.