Background. Acute exacerbation of IPF (AE-IPF) is associated with high mortality. We studied changes in pathogen involvement during AE-IPF and explored a possible role of infection in AE-IPF. Objectives. Our purpose is to investigate the role of infection in AE-IPF. Methods. Overall, we recruited 170 IPF patients (48 AE-IPF, 122 stable) and 70 controls at Shanghai Pulmonary Hospital. Specific IgM against microbial pathogens and pathogens in sputum were assessed. RNA sequences of pathogens in nasopharyngeal swab of IPF patients were detected by PathChip. A panel of serum parameters reflecting immune function were assessed. Results. Antiviral/bacterial IgM was higher in IPF vs. controls and in AE-IPF vs. stable IPF. Thirty-eight different bacterial strains were detected in IPF patient sputum. Bacteria-positive results were found in 9/48 (18.8%) of AE-IPF and in 26/122 (21.3%) stable IPF. Fifty-seven different viruses were detected in nasopharyngeal swabs of IPF patients. Virus-positive nasopharyngeal swabs were found in 18/30 (60%) of tested AE-IPF and in 13/30 (43.3%) of stable IPF. AE-IPF showed increased inflammatory cytokines (IL-6, IFN-γ, MIG, IL-17, and IL-9) vs. stable IPF and controls. Mortality of AE-IPF in one year (39.5%) was higher compared to stable IPF (28.7%).Conclusions. IPF patients had different colonization with pathogens in sputum and nasopharyngeal swabs; they also displayed abnormally activated immune response, which was exacerbated during AE-IPF.