Objective: To study the association between wheezy symptoms in young children and the presence of bacteria in the airways. Design: Birth cohort study. Setting: Clinical research unit in Copenhagen. Participants: Children of asthmatic mothers, from age 4 weeks to 3 years, with planned visits and acute admissions to the research clinic. Main outcome measure: Frequency of bacteria and virus carriage in airway aspirates during wheezy episodes and at planned visits without respiratory symptoms. Results: 984 samples (361 children) were analysed for bacteria, 844 (299 children) for viruses, and 696 (277 children) for both viruses and bacteria. Wheezy episodes were associated with both bacterial infection (odds ratio 2.9, 95% confidence interval 1.9 to 4.3; P<0.001) and virus infection (2.8, 1.7 to 4.4; P<0.001). The associations of bacteria and viruses were independent of each other. Conclusion: Acute wheezy episodes in young children were significantly associated with bacterial infections similar to but independent of the association with virus infections.