The characteristics and roles of microbes in the occurrence and development of pulmonary nodules are still unclear. We retrospectively analyzed the microbial mNGS results of BALF from 229 patients with pulmonary nodules before surgery, and performed a comparative analysis of lung flora between lung cancer and benign nodules according to postoperative pathology. The analysis also focused on investigating the characteristics of lung microbiota in lung adenocarcinomas with varying histopathology. There were differences in lung microbiota between lung cancer and benign lung nodules. Bacterial diversity was lower in lung cancer than in benign lung nodules. Four species (Porphyromonas somerae, Corynebacterium accolens, Burkholderia cenocepacia and Streptococcus mitis) were enriched in lung cancer compared with the benign lung nodules. The areas under the ROC curves of these four species were all greater than 0.6, and the AUC of Streptococcus mitis was 0.702, which had the highest diagnostic value for differentiating lung cancer from benign lung diseases. The significantly enriched microbiota varied with the different pathological subtypes of lung adenocarcinoma. Streptococcus mitis, Burkholderia oklahomensis and Burkholderia latens displayed a trend of increasing from the benign lung disease group to the AIS group, MIA group and IAC group, whereas Lactobacillus plantarum showed a downward trend. Changes in the abundance of lung microbiota are closely related to the development of infiltrating adenocarcinoma. Our findings provide new insights into the relationship between the changes in lung microbiota and the development of lung cancer.