Background and aims Restless legs syndrome is a sensorimotor disorder associated with mental health conditions notably depression. Restless legs symptoms and depression are commonly associated with pain. The study investigated the influence of restless legs symptoms on musculoskeletal pain in patients with depression or with increased depressive symptoms. Methods A cross-sectional study of primary care patients in the Central Finland Hospital District. The prevalence of restless legs symptoms was studied in patients with depressive symptoms (n = 695) and controls without a psychiatric diagnosis (n = 410) by using a structured questionnaire. The depressive symptoms were evaluated with the Beck Depression Inventory and the psychiatric diagnosis was confirmed by means of a diagnostic interview (MINI). The prevalence and intensity of musculoskeletal pain was captured with form-based questions. A single-question screen for restless legs symptoms was applied. Results There was a significant difference in the prevalence of continuous widespread musculoskeletal pain between the three study groups: the controls 4.6% (95% CI: 2.8-7.1), the patients with symptoms of depression without a diagnosis 16.0% (11.7-21.1), and the patients with diagnosed depression 22.1% (18.3-23.3) (p = 0.006 after being adjusted for age, sex, smoking, use of alcohol, education years, body mass index, use of antidepressants, and physical activity, after multiple corrections, all groups were significantly different from each other). Compared with those not having restless legs symptoms, subjects with restless legs symptoms had more often continuous widespread musculoskeletal pain in the control subjects (p = 0.001; 2.3% vs. 10.5%) and in the patients with depressive symptoms without a depression diagnosis (p = 0.024; 9.1 vs. 18.7%) but not in those with diagnosed depression (p = 0.98; 19.5 vs. 19.4%). The restless legs symptoms were associated with the intensity of pain in all groups (p < 0.001). Conclusions Restless legs symptoms were related to continuous widespread musculoskeletal pain in subjects without depressive symptoms and in patients with depressive symptoms without a depression diagnosis. Pain intensity was higher in the subjects with restless legs symptoms regardless of depressive symtoms or depression. Implications Clinical management of pain in patients with restless legs symptoms should include an increased focus on the prevention and treatment of either conditions.