Women have higher mortality rates after coronary artery bypass graft (CABG) surgery compared with men. Explanations for this sex difference are controversial. The objective of this study was to assess whether infection contributes to the increased risk of mortality in women. We conducted a cohort study of 9218 Michigan Medicare beneficiaries hospitalized for CABG surgery. The prevalence of infection at any site during hospitalization was determined. Patients were followed up for 100 days after surgery to assess vital status. Analyses were conducted using proportional hazards regression and population attributable risk. Women hospitalized for CABG surgery were more likely to have an infection than men (16.1% vs 9.8%, P<.001), regardless of age, race, type of admission, hospital volume, or presence of comorbidities. Infections of the respiratory tract, urinary tract, digestive tract, and skin and subcutaneous tissue were more common in women than in men. The risk of death in men increased 3-fold with infection, whereas the risk in women increased 1.8-fold. The interaction between infection and sex on mortality was significant after adjusting for age, type of admission, and presence of comorbidities (P=.008). The unadjusted percentage of deaths attributable to female sex was 13.9%, which decreased to 0.3% when adjusted for infection. Of the excess deaths in women, 96% could be accounted for by the differential distribution of infection between the sexes. The increased risk of mortality after CABG surgery in women may be explained by underlying differences in the prevalence of infection among men and women.