BACKGROUND: Long-term disorders are the main challenge facing health-care systems worldwide, but health systems are largely configured for individual diseases rather than multimorbidity. We examined the distribution of multimorbidity, and of comorbidity of physical and mental health disorders, in relation to age and socioeconomic deprivation. METHODS: In a cross-sectional study we extracted data on 40 morbidities from a database of 1?751?841 people registered with 314 medical practices in Scotland as of March, 2007. We analysed the data according to the number of morbidities, disorder type (physical or mental), sex, age, and socioeconomic status. We defined multimorbidity as the presence of two or more disorders. FINDINGS: 42·2% (95% CI 42·1-42·3) of all patients had one or more morbidities, and 23·2% (23·08-23·21) were multimorbid. Although the prevalence of multimorbidity increased substantially with age and was present in most people aged 65 years and older, the absolute number of people with multimorbidity was higher in those younger than 65 years (210?500 vs 194?996). Onset of multimorbidity occurred 10-15 years earlier in people living in the most deprived areas compared with the most affluent, with socioeconomic deprivation particularly associated with multimorbidity that included mental health disorders (prevalence of both physical and mental health disorder 11·0%, 95% CI 10·9-11·2% in most deprived area vs 5·9%, 5·8%-6·0% in least deprived). The presence of a mental health disorder increased as the number of physical morbidities increased (adjusted odds ratio 6·74, 95% CI 6·59-6·90 for five or more disorders vs 1·95, 1·93-1·98 for one disorder), and was much greater in more deprived than in less deprived people (2·28, 2·21-2·32 vs 1·08, 1·05-1·11). INTERPRETATION: Our findings challenge the single-disease framework by which most health care, medical research, and medical education is configured. A complementary strategy is needed, supporting generalist clinicians to provide personalised, comprehensive continuity of care, especially in socioeconomically deprived areas. FUNDING: Scottish Government Chief Scientist Office.