Repeated cycles of infection-associated lower airway inflammation drive the pathogenesis of persistent wheezing disease in children. In this study, the occurrence of acute respiratory tract illnesses (ARIs) and the nasopharyngeal microbiome (NPM) were characterized in 244 infants through their first five years of life. Through this analysis, we demonstrate that >80% of infectious events involve viral pathogens, but are accompanied by a shift in the NPM toward dominance by a small range of pathogenic bacterial genera. Unexpectedly, this change frequently precedes the detection of viral pathogens and acute symptoms. Colonization of illness-associated bacteria coupled with early allergic sensitization is associated with persistent wheeze in school-aged children, which is the hallmark of the asthma phenotype. In contrast, these bacterial genera are associated with “transient wheeze” that resolves after age 3 years in non-sensitized children. Thus, to complement early allergic sensitization, monitoring NPM composition may enable early detection and intervention in high-risk children. Teo et al. characterize nasopharyngeal microbiota (NPM) in 244 children from birth to age 5 years during periods of illness and health. NPM colonization with illness-associated bacteria may promote acute respiratory illness independent of viral infection, and is associated with chronic or transient wheeze in allergic-sensitized or non-sensitized children, respectively.