Background Smokers report more pain and worse functioning. The evidence from pain clinics suggests that depression affects this relationship: The association between smoking and chronic pain is weakened when controlling for depression. This study explored the relationship between smoking, pain and depression in a large general population-based cohort (Generation Scotland: Scottish Family Health Study). Methods Chronic pain measures (intensity, disability), self-reported smoking status and a history of major depressive disorder (MDD) were analysed. A multivariate analysis of covariance determined whether smoking status was associated with both pain measures and a history of depressive illness. Using a statistical mediation model any mediating effect of depression on the relationship between smoking and chronic pain was sought. Results Of all 24,024 participants, 30% ( n =7162) reported any chronic pain. Within this chronic pain group, 16% ( n =1158) had a history of MDD; 7108 had valid smoking data: 20% ( n =1408) were current smokers, 33% ( n =2351) former and 47% ( n =3349) never smokers. Current smokers demonstrated higher pain intensity and pain-related disability scores compared with former and non-smokers (p0.001 for all analyses). From the mediation model, the effect on pain intensity decreased ( p ?0.001), indicating that the relationship between smoking and a history of depression contributes significantly to the effect of smoking on pain intensity. When applied to smoking-related pain disability, there was no mediation effect. Conclusions In contrast to smokers treated in pain clinics, a history of MDD mediated the relationship between smoking and pain intensity, but not pain-related disability in smokers in the community.