BackgroundFibromyalgia (FM) patients frequently complain of cognitive problems, but it remains unclear whether these cognitive complaints can be attributed to a dysfunction of the central nervous system or if they can be explained by other factors associated with the disease, such as depression, anxiety and sleep dysfunction.MethodsOne hundred and ten patients with FM were compared with thirty-three patients diagnosed with a depressive disorder (DD) and fifty healthy controls (HC). Several measures of attention and executive functions were used to make these comparisons and the patients were also asked to complete questionnaires on depression, anxiety and sleep quality. Univariate analyses of covariance (ANCOVA) were performed to identify and control confounders and multiple linear models were used to examine the effects of fibromyalgia and depression on cognitive measures.ResultsFM and HC differed significantly with respect to depression, anxiety and sleep dysfunction, whereas FM and DD did not differ in terms of symptoms of depression and anxiety. However, FM was associated with a worse quality of sleep than DD. Comparisons of cognitive performance between groups showed that short-term and working memory and inattention measures were only associated with symptoms of depression, whereas selective attention was associated with both depression and fibromyalgia, and processing speed, cognitive flexibility and inhibitory control showed a significant interaction between depression and fibromyalgia. Moreover, cognitive flexibility and inhibition abilities were specifically associated with FM.ConclusionFM patients show a cluster of cognitive impairment in the attentional and executive domains, although some of the symptoms observed could be explained by the severity of the symptoms of depression, while others seem to depend on the effects of fibromyalgia. Implications of the findings for the understanding and management of cognitive impairment of FM patients are discussed.