Impaired baseline lung function is associated with mortality after pediatric allogeneic hematopoietic cell transplantation (HCT), yet limited knowledge of the molecular pathways that characterize pretransplant lung function has hindered the development of lung-targeted interventions. In this study, we quantified the association between bronchoalveolar lavage (BAL) metatranscriptomes and paired pulmonary function tests performed a median of 1 to 2 weeks before allogeneic HCT in 104 children in The Netherlands. Abnormal pulmonary function was recorded in more than half the cohort, consisted most commonly of restriction and impaired diffusion, and was associated with both all-cause and lung injury-related mortality after HCT. Depletion of commensal supraglottic taxa, such as Haemophilus, and enrichment of nasal and skin taxa, such as Staphylococcus, in the BAL microbiome were associated with worse measures of lung capacity and gas diffusion. In addition, BAL gene expression signatures of alveolar epithelial activation, epithelial-mesenchymal transition, and down-regulated immunity were associated with impaired lung capacity and diffusion, suggesting a postinjury profibrotic response. Detection of microbial depletion and abnormal epithelial gene expression in BAL enhanced the prognostic utility of pre-HCT pulmonary function tests for the outcome of post-HCT mortality. These findings suggest a potentially actionable connection between microbiome depletion, alveolar injury, and pulmonary fibrosis in the pathogenesis of pre- HCT lung dysfunction.