Broad-spectrum antibiotics are widely used with patients in intensive care units (ICUs), many of whom develop hospital-acquired infections with Pseudomonas aeruginosa. Although preceding antimicrobial therapy is known as a major risk factor for P. aeruginosa–induced pneumonia, the underlying mechanisms remain incompletely understood. Here we demonstrate that depletion of the resident microbiota by broad-spectrum antibiotic treatment inhibited TLR-dependent production of a proliferation-inducing ligand (APRIL), resulting in a secondary IgA deficiency in the lung in mice and human ICU patients. Microbiota-dependent local IgA contributed to early antibacterial defense against P. aeruginosa. Consequently, P. aeruginosa–binding IgA purified from lamina propria culture or IgA hybridomas enhanced resistance of antibiotic-treated mice to P. aeruginosa infection after transnasal substitute. Our study provides a mechanistic explanation for the well-documented risk of P. aeruginosa infection following antimicrobial therapy, and we propose local administration of IgA as a novel prophylactic strategy.