To study risk factors of neonatal nosocomial infection caused by extended-spectrum beta-lactamase (ESBL)-producing bacteria in a neonatal intensive care unit (NICU). A retrospective cohort study was conducted in a university hospital NICU in south China. Medical records of neonatal nosocomial infection caused by Escherichia coli or Klebsiella pneumoniae were reviewed. Twenty-two neonates infected with ESBL-producing bacteria (case patients) were compared with 17 patients infected with non-ESBL producing strains (controls). Univariable and multivariable logistic regression were performed to analyze risk factors for infection with ESBL-producing strains. The spectrum of antimicrobial resistance of ESBL-positive E. coli or K. pneumoniae was also examined. Both univariable and multivariable logistic regression analysis revealed that preterm low birth weight, prolonged mechanical ventilation (> or = 7 days) and prior use of third-generation cephalosporins were risks factors for ESBL-producing E. coli or K. pneumoniae infection (p < 0.05), with an odd ratio of 6.43 (95% CI: 1.51-27.44; p = 0.017), 7.50 (95% CI: 1.38-40.88; p = 0.017) and 9.00 (95% CI: 1.65-49.14; p = 0.008) respectively. However, the length of hospital stay before isolation of pathogens, endotracheal intubation, presence of a central venous catheter, days on third-generation cephalosporins and prior use of beta-lactamase inhibitors were not statistically significant (p > 0.05). Resistance of ESBL-positive strains to piperacillin, tobramycin, aztreonam and cephalosporins was significantly higher than that of ESBL-negative ones (p < 0.05). ESBL-producing strains appeared susceptible to carbapenem, fluoroquinolones, and beta-lactamase inhibitor combination piperacillin-tazobactam. Preterm low birth weight, prolonged mechanical ventilation and prior use of third-generation cephalosporins are risks factors for nosocomial infection with ESBL-producing bacteria in NICU.