The extremely high risk reported for some types of cancer among patients with common variable immunodeficiency (CVID) is based on a limited number of investigations. Therefore, we examined the risks for cancer among 562 Danish and Swedish patients with CVID or IgA deficiency and 2071 relatives in 1958–96. The patients were identified through an Immunodeficiency Register and hospital records, while the relatives were traced through population registers. Cancer incidence was assessed by linkage to the Cancer Registries and compared with that in the general population. Among 386 patients with IgA deficiency, the incidence of cancer was not increased (standardized incidence ratio (SI) = 1·0); but two cases of stomach cancer were found, resulting in a non-significant increase in risk (SIR = 5·4; 95% CI = 0·7–19·5). Among 176 patients with common variable immunodeficiency (CVID), the incidence of cancer at all sites combined was increased (SIR = 1·8; 95% CI = 1·0–2·9), which was due mainly to significant excesses of malignant lymphoma (obs = 4; SIR = 12·1; 95% CI = 3·3–31·0) and of stomach cancer (obs = 3; SIR = 10·3; 95% CI = 2·1–30·2). Among the 626 relatives of patients with CVID, no increase in risk was found for these types of cancer or for cancer overall (obs = 53; SIR = 1·0; 95% CI = 0·8–1·3). Our data show that the risks for malignant lymphoma and stomach cancer among patients with CVID may be lower than reported previously. The absence of an increased risk among relatives suggests that the increased cancer morbidity in patients with CVID is related to the immunodeficiency per se rather than to specific genetic traits shared with their relatives.