ObjectiveTo investigate associations between body mass index (BMI) and risk of COVID-19 diagnosis, hospitalisation with COVID-19, and COVID-19-related death, accounting for potential effect modification by age and sex.DesignPopulation-based cohort study.SettingPrimary care records covering >80% of the Catalonian population (Spain), linked to region-wide testing, hospital, and mortality records from March to May 2020.ParticipantsPeople aged ≥18 years with at least one measurement of weight and height from the general population and with at least one year of prior medical history available.Main outcome measuresCause-specific hazard ratios (HR) with 95% confidence intervals for each outcome.ResultsOverall, 2,524,926 participants were followed up for a median of 67 days. A total of 57,443 individuals were diagnosed with COVID-19, 10,862 were hospitalised with COVID-19, and 2,467 had a COVID-19-related death. BMI was positively associated with being diagnosed as well as hospitalised with COVID-19. Compared to a BMI of 22kg/m2, the HR (95%CI) of a BMI of 31kg/m2 was 1.22 (1.19-1.24) for COVID-19 diagnosis, and 1.88 (1.75-2.03) and 2.01 (1.86-2.18) for hospitalisation without and with a prior outpatient diagnosis, respectively. The relation between BMI and risk of COVID-19 related death was J-shaped. There was a modestly higher risk of death among individuals with BMIs≤19 kg/m2 and a more pronounced increasing risk for BMIs ≥37 kg/m2 and ≥40 kg/m2 among those who were previously hospitalised with COVID-19 and diagnosed with COVID-19 in outpatient settings, respectively. The increase in risk for COVID-19 outcomes was particularly pronounced among younger patients.ConclusionsThere is a monotonic association between BMI and COVID-19 infection and hospitalisation risks, but a J-shaped one with mortality. More research is needed to unravel the mechanisms underlying these relationships.Summary boxesSection 1: What is already known on this topicA high body mass index (BMI) has previously been associated in a linear and non-linear fashion with an increased risk of multiple health outcomes; these associations may vary by individual factors such as age and sex.Obesity has been identified as a risk factor for COVID-19 severity and mortality. However, the role of general adiposity in relation to COVID-19 outcomes has mostly been studied by dichotomizing BMI (below or above 30 kg/m2) or by a diagnostic code indicating obesity.Two studies have investigated BMI (as a continuous variable) in relation to COVID-19 outcomes, accounting for non-linearity: one conducted in a tested population sample of the UK Biobank found BMI is related in a dose-response manner with the risk of testing positive for COVID-19; another conducted in a hospital setting in New York reported a J-shaped association between BMI and the risk of intubation or death. These studies were limited in sample size and were prone to collider bias due to the participant’s restriction to tested and hospitalised patients. No studies have described the association between BMI and COVID-19 outcomes across the natural history of the disease (from no disease to symptomatic disease, hospitalisation, and mortality) using data from diverse health settings.Section 2: What this study addsWe provide a comprehensive analysis of the association between BMI and the course of the COVID-19 disease in the general population of a Spanish region during the first wave of the pandemic, using linked data capturing outpatient clinical diagnoses, RT-PCR test results, hospitalisations, and mortality (inside and outside of the hospital setting).We found that BMI is positively associated with being diagnosed as well as hospitalised with COVID-19, and is linked in a J-shaped fashion with the risk of COVID-19 related death.The association between BMI and COVID-19 related outcomes is modified by age and sex; particularly, the risk of COVID-19 outcomes related to increased BMI is higher for those aged between 18 and 59 years, compared to those in older age groups.