Objectives To assess the association between demographic and clinical risk factors and asthma-related hospital and intensive care admissions in children, adolescents, and adults, and to estimate the proportion of hospital admissions attributable to modifiable risk factors. Design Cohort study using routinely collected primary and secondary care data. Setting A large UK-based primary care database, the Clinical Practice Research Datalink (CPRD) Aurum, and linked Hospital Episode Statistics Admitted Patient Care (HES APC) data. Participants Patients were eligible for the study if they were aged five years and older and had an asthma diagnosis with linked data to the HES APC database. This included 90,989 children aged 5-11 years, 114,927 adolescents aged 12-17 years, and 1,179,410 adults aged 18 years or older. Primary and secondary outcome measures Primary outcome: asthma-related hospital admissions recorded from 1st January 2017 to 31st December 2019. Secondary outcome: asthma-related intensive care unit (ICU) admissions. Incidence rate ratios (IRR) adjusted for demographic and clinical risk factors were estimated using negative binomial models. Population attributable fraction (PAF) amongst those with asthma was estimated for modifiable risk factors that were statistically significantly associated with the primary outcome. Results In children, the risk factors for asthma-related hospital admission were belonging to an ethnic minority group, increasing socioeconomic deprivation, allergies (PAF 11.4%, 95% CI 6.8 to 15.8), and atopic eczema (6.8%, 3.6 to 9.9). In adolescents, the risk factors were being female, belonging to an ethnic minority group, increasing socioeconomic deprivation, former smoking (PAF 6.8%, 0.9 to 12.3), and allergic rhinitis. In adults, the risk factors were younger age, being female, belong to an ethnic minority group, increasing socioeconomic deprivation, being underweight, overweight or obese (PAF 23.3%, 95% CI 20.5 to 26.1 for obesity), current smoking (4.3%, 3.0 to 5.7), depression (11.1%, 9.1 to 13.1), allergies (6.2%, 4.4 to 8.0), gastro-oesophageal reflux disease (2.3%, 1.2 to 3.4), anxiety (2.0%, 0.5 to 3.6), and chronic rhinosinusitis (0.8%, 0.3 to 1.3%). In all age groups, increasing medication burden was associated with an increased risk in the primary outcome. Risk factors for asthma-related ICU admissions in children were black or mixed ethnicity and high levels of socioeconomic deprivation; in adolescents, they were female sex and black ethnicity; and in adults, they were younger age, female sex, black, mixed, or Asian ethnicity, and depression. In all age groups, increasing medication burden was associated with an increased risk in the secondary outcome. Conclusions There are significant sociodemographic inequalities in the rates of asthma-related hospital and ICU admissions. Treating atopic conditions in all age groups should be considered an integral part of asthma management. Adults have a wide range of potentially treatable risk factors that contribute substantially to asthma-related hospital admissions, including obesity, smoking, depression, anxiety and gastro-oesophageal reflux disease. Treating these risk factors could significantly reduce the rate of avoidable hospital admissions. Overall asthma medication burden is an important reflection of disease severity and prognostic marker of asthma outcomes, which should be monitored in all patients.