BackgroundMicrobes colonizing lower airways can regulate the host immune profile and consequently participate in lung disease. Increasing evidence indicate that individual microbes promote lung cancer progression and are involved in metastasis incidence. To date, however, no study has revealed the community structure of lung bacteria in metastatic non-small cell lung cancer (NSCLC) patients.MethodsWe prospectively enrolled 50 healthy subjects and 57 NSCLC patients. All healthy subjects and NSCLC patients underwent bronchoscope procedures for brush specimen collection. The 16 S ribosomal RNA gene was sequenced to characterize the community structure of lung mucosa-colonizing bacteria. The peripheral blood of NSCLC patients was also measured for leukocytes and cancer markers.ResultsThe lung bacteria of healthy subjects and NSCLC patients were divided into four communities. All community 2 members showed increased abundance in NSCLC patients compared with healthy subjects, and most community 2 members showed increased abundance in the metastatic NSCLC patients compared with the non-metastatic group. These bacteria were significantly and positively correlated with eosinophils, neutrophils and monocytes in the metastatic NSCLC group. In addition, the correlation between lung bacteria and cancer markers differed between the metastatic and non-metastatic NSCLC patients. Furthermore, bronchoalveolar lavage fluid from lung adenocarcinoma patients directly promoted NSCLC cell migration.ConclusionsThe community structure of lung mucosa-colonizing bacteria was relatively stable, but changed from the healthy population to NSCLC patients, especially the metastatic group. This distinct community structure and specific correlation with immune cells and cancer markers could help to distinguish NSCLC patients with or without metastasis.Supplementary InformationThe online version contains supplementary material available at 10.1186/s12931-023-02420-7.