Background Fibromyalgia (FM) is a complex multidimensional disorder with pain as its main symptom. Fibromyalgia imposes a psychosocial burden on individuals that negatively impacts quality of life. The relationship of dietary habits with these psychosocial aspects is still unclear. Objective The purpose of this cross-sectional study was to assess dietary habits in a representative sample of women with FM and to explore their association with mental health, depression, and optimism in this population. Design A cross-sectional study was conducted between November 2011 and January 2013. Participants The study sample comprised 486 women (ages 35 to 65 years) with FM from Andalucía (southern Spain). Main outcome measures Mental health, depression, and optimism were evaluated by means of the mental component scale of the 36-item Short-Form Health Survey, the Beck Depression Inventory (BDI-II), and the Life Orientation Test Revised, respectively. A short form of a validated food frequency questionnaire was used to assess dietary habits. Statistical analyses performed Analysis of covariance was used to assess associations between dietary habits and mental health, depression, and optimism. The presence of severe depression (BDI-II ≥29) as a function of dietary habits was examined with logistic regression. Results A daily or almost-daily consumption of fruit and vegetables and a moderate consumption of fish (2 to 5 servings per week) were associated with higher scores in mental health (P<0.001, P<0.05, and P<0.001, respectively) and lower levels of depression (P<0.001, P<0.01, and P<0.01, respectively). A daily or almost-daily consumption of vegetables and a moderate consumption of dairy products and fish were associated with higher levels of optimism (P<0.05, P<0.05, and P<0.001, respectively). A daily or almost-daily consumption of cured meats and sweetened beverages were associated with higher levels of depression and lower levels of optimism, respectively (both P<0.05). Conclusion The results this study suggest that a daily or almost-daily intake of fruit and vegetables and a moderate intake of fish may be associated with more favorable psychosocial outcomes in women with FM. Conversely, excessive intake of cured meats and sweetened beverages was related to worse scores in optimism and depression outcomes. Future research analyzing dietary patterns as well as intervention studies evaluating the effects of healthy dietary patterns on psychosocial and physical outcomes in individuals with FM are warranted.