Background Lower respiratory tract infections (LRTIs) are a leading cause of childhood morbidity and mortality. Potentially pathogenic organisms are present in the respiratory tract in both symptomatic and asymptomatic children, but their presence does not necessarily indicate disease. We aimed to assess the concordance between upper and lower respiratory tract microbiota during LRTIs and the use of nasopharyngeal microbiota to discriminate LRTIs from health.Methods First, we did a prospective study of children aged between 4 weeks and 5 years who were admitted to the paediatric intensive care unit (PICU) at Wilhelmina Children's Hospital (Utrecht, Netherlands) for a WHO-defined LRTI requiring mechanical ventilation. We obtained paired nasopharyngeal swabs and deep endotracheal aspirates from these participants (the so-called PICU cohort) between Sept 10, 2013, and Sept 4, 2016. We also did a matched case-control study (1:2) with the same inclusion criteria in children with LRTIs at three Dutch teaching hospitals and in age-matched, sex-matched, and time-matched healthy children recruited from the community. Nasopharyngeal samples were obtained at admission for cases and during home visits for controls. Data for child characteristics were obtained by questionnaires and from pharmacy printouts and medical charts. We used quantitative PCR and 16S rRNA-based sequencing to establish viral and bacterial microbiota profiles, respectively. We did sparse random forest classifier analyses on the bacterial data, viral data, metadata, and the combination of all three datasets to distinguish cases from controls.Findings 29 patients were enrolled in the PICU cohort. Intra-individual concordance in terms of viral microbiota profiles (96% agreement [95% CI 93-99]) and bacterial microbiota profiles (58 taxa with a median Pearson's r 0·93 [IQR 0·62-0·99]; p<0·05 for all 58 taxa) was high between nasopharyngeal and endotracheal aspirate samples, supporting the use of nasopharyngeal samples as proxy for lung microbiota during LRTIs. 154 cases and 307 matched controls were prospectively recruited to our case-control cohort. Individually, bacterial microbiota (area under the curve 0·77), viral microbiota (0·70), and child characteristics (0·80) poorly distinguished health from disease. However, a classification model based on combined bacterial and viral microbiota plus child characteristics distinguished children with LRTIs from their matched controls with a high degree of accuracy (area under the curve 0·92).Interpretation Our data suggest that the nasopharyngeal microbiota can serve as a valid proxy for lower respiratory tract microbiota in childhood LRTIs, that clinical LRTIs in children result from the interplay between microbiota and host characteristics, rather than a single microorganism, and that microbiota-based diagnostics could improve future diagnostic and treatment protocols.