The objective of this study was to identify risk factors for bacteremia by extended-spectrum β-lactamase (ESBL)-producing Escherichia coli and Klebsiella pneumoniae. Retrospective casecontrol study performed in a 450-bed acute care academic tertiary hospital in Barcelona, Spain. Cases included 53 patients with ESBL-producing E. coli or K. pneumoniae bacteremia, and 159 controls with non-ESBL-producing E. coli or K. pneumoniae bacteremia. Controls were matched in a 3:1 ratio to case patients according to species of infecting organism, age, and severity of illness in the 24-48h before blood sample collection for culture calculated by the Simplified Acute Physiology Score (SAPS II) system. Previous antimicrobials were more frequently administered to cases than to controls (56.5% vs 17%, p < 0.001). Binary logistic regression showed that the number (> 2) of different families of antimicrobials received within 90 days before bloodstream infection was the only predictor of ESBL-producing E. coli or K. pneumoniae in blood culture (OR = 2.29, 95% CI 1.35-3.88, p = 0.002). Conclusion: Previous use of different families of antimicrobials (more than two) in patients with bloodstream infection caused by E. coli or K. pneumoniae increased the risk for ESBL-producing strains.