Background:: Mental and behavioral disorders are influenced by biological, psychological and social factors, especially income, gender, age and family environment, indicating that physical health is directly associated with mental health. In this perspective, food consumption is highlighted as a risk factor for mental health, as healthy behaviors, along with a good quality diet, can reduce symptoms of anxiety and depression. Objective:: The objective of this a study is to investigate the association between CMD and dietary patterns, among other lifestyle and socioeconomic factors. Method:: Cross-sectional population-based and household study conducted with 1574 individuals aged over 20 years, of both sexes, residing in Teresina and Picos, Piaui, Brazil. Sociodemographic, lifestyle and food consumption data were collected. The instrument used to identify the presence of CMDs was the Self Reporting Questionnaire 20 (SRQ-20). Dietary patterns were obtained using the Principal Component Analysis method. Results:: Individuals of female sex, separated, with low education, smokers and lower level of physical activity had a higher prevalence of common mental disorders. As for the eating pattern, after adjustments, individuals who adhered to the unhealthy eating pattern had a 9% higher prevalence of CMD. Furthermore, adherence to the white meat standard represented 12% higher prevalence of CMD. Conclusion:: The results showed that, regardless of other socioeconomic and lifestyle factors, adherence to a more monotonous eating pattern in foods, characterized by the mainly consumption of animal protein and the lack consumption of foods like fruits and vegetables, as well as a less healthy one, characterized by the consumption of ultra-processed foods, increases the risk of developing CMD.