Background. Previous studies found an increased risk of cancer in hospitalized asthma patients, but it is not known whether patients from primary health care show a similar risk pattern. In addition, it is unclear whether the diagnosis of asthma can influence the prognosis of subsequent cancer.Methods. Asthma patients were identified from Swedish inpatient, outpatient, and primary health care registers, and were linked to the Swedish Cancer Registry to identify subsequent diagnoses of cancer. Standardized incidence ratios (SIRs) were used to examine the risk of cancer in asthma patients compared with subjects without asthma. In addition, we used Cox proportional hazards regression to estimate hazard ratios (HRs) for mortality in patients with both asthma and cancer.Results. A total of 10 649 cancers were diagnosed in patients with previous asthma, with a SIR of 1.19 (95% CI 1.17-1.21). A total of 15 cancer sites showed an increased incidence, whereas two cancer sites showed a decreased risk. Non-allergic asthma showed the highest risk of cancer (SIR = 1.25, 95% CI 1.18-1.32), followed by unspecified asthma (SIR = 1.22, 95% CI 1.19-1.25), status asthmaticus (SIR = 1.19, 95% CI 1.02-1.39), and allergic asthma (SIR = 1.14, 95% CI 1.06-1.22). The risk of cancer was similarly increased in asthma patients diagnosed in primary health care and those diagnosed in hospitals. Cancer patients with previous asthma had increased mortality, with a HR of 1.55 (95% CI 1.50-1.60). HRs ranged from 1.09 to 1.94 for different sites/types of cancer.Conclusions. Patients with asthma, irrespective of whether they were treated in primary health care or hospitals, had an increased risk of cancer. In addition, cancer patients with previous asthma had a worse prognosis compared with those without asthma, suggesting that these patients may require a multidisciplinary approach to manage the comorbidity.