Background: Community-acquired bacteremia (CAB) with Escherichia coli may signal occult cancer. This might differ between phylogenetic groups. Methods: We conducted a population-based cohort study in northern Denmark (1994-2013) to examine whether E. coli CAB after age 50 is associated with incident cancer. We followed patients from their bacteremia diagnosis date to identify subsequent gastrointestinal, hepatobiliary, and urinary tract cancer diagnoses. We calculated 1- and 5-year cumulative cancer incidence. We compared the observed incidence with that expected based on national cancer incidence rates, and computed standardized incidence ratios (SIR) at 0-<1 year and >1 year. In a subcohort, we assessed the prevalence of phylogenetic groups. Results: Among 2,735 patients with E. coli CAB, 173 later were diagnosed with cancer. The 1-year cumulative incidence of a gastrointestinal or hepatobiliary tract cancer was 1.9%, and the 0-<1-year SIR was 5.44 [95% confidence interval (CI), 4.06-7.14]. For urinary tract cancer, the corresponding estimates were 1.0% and 3.41 (95% CI, 2.27-4.93). All individual cancers occurred more often than expected during the first year following E. coli CAB, but thereafter the relative risks declined toward unity. Still, the ≥1-year SIR for colorectal cancer remained 1.4-fold elevated, and the SIR for liver, pancreas, gallbladder, and biliary tract cancer was 2-fold elevated. The prevalence of phylogenetic groups was similar among patients with and without cancer. Conclusions: Gastrointestinal, hepatobiliary, and urinary tract cancer may debut with E. coli CAB. Impact: Owing to the high incidence of E. coli bacteremia, cancers missed at the time of bacteremia diagnosis represent a clinically significant problem.