Background Cancer patients are at increased risk of infection. Fecal carriage of extended-spectrum β-lactamase-producing Enterobacteriaceae (ESBL-PE) may increase this risk. There are few studies on the prevalence of ESBL-PE colonization and surgical site infections (SSIs). Methods This prospective cohort study included patients with gastrointestinal and gynecological malignancies who were admitted to the hospital for elective surgery. Rectal swab cultures were obtained on the day of admission and during the postoperative period every 5 days. Prevalence of ESBL-PE fecal colonization and risk factors for the development of SSI were assessed. Results We included 171 patients, 30 (17.5%) of whom were colonized with ESBL-PE at admission. This proportion increased to 21% (37 of 171) of the samples during the hospital stay. Incidence of SSI was 14.6% (n = 25). Ten of 37 (27%) patients colonized by ESBL-PE developed SSI versus 15 of 134 (11%) of the non-ESBL-PE (relative risk [RR], 2.163; 95% confidence interval [CI], 1.201-3.897; P = .016). Five patients developed a bloodstream infection, and 4 patients were colonized with ESBL-PE (RR = 4.02; 95% CI, 1.2-3.89; P = .008). Conclusions The rate of ESBL-PE fecal colonization in surgical patients was 17.5%. Colonization of ESBL-PE duplicated the risk of SSI by the same strain and, by a factor of 4, the risk of bloodstream infections.