ABSTRACTNon-small cell lung cancer (NSCLC) is the leading cause of cancer-related deaths worldwide. Although dysbiosis of the lung and gut microbiota have been associated with NSCLC, their relative contributions are unclear; in addition, their roles in distant metastasis (DM) are still illusive. We recruited in total 121 participants, including 87 newly diagnosed treatment-naive NSCLC patients of various stages and 34 healthy volunteers, and surveyed their fecal and sputum microbiota. We compared the microbial profiles between groups, identified microbial biomarkers, and generated machine learning models for distinguishing healthy individuals from patients with NSCLC and patients of various stages. We found significant perturbations of gut and sputum microbiota in patients with NSCLC and DM. A machine learning model combining both microbiota (combined model) performed better than an individual data set in patient stratification, with the highest area under the curve (AUC) value of 0.896. Sputum and gut microbiota both contributed to the combined model; in most cases, sputum-only models performed similar to the combined models. Several microbial biomarkers were shared by both microbiotas, indicating their similar roles at distinct body sites. Microbial biomarkers of distinct disease stages were mostly shared, suggesting biomarkers for DM could be acquired early. Furthermore, Pseudomonas aeruginosa, a species previously associated with wound infections, was significantly more abundant in brain metastasis, indicating that distinct types of DMs could have different microbes. Our results indicate that alterations of the sputum microbiota have stronger relationships with NSCLC and DM than the gut and strongly support the feasibility of metagenome-based noninvasive disease diagnosis and risk evaluation. (This study has been registered at ClinicalTrials.gov under registration no. NCT03454685).IMPORTANCE Our survey on gut and sputum microbiota revealed that both were significantly disturbed in non-small cell lung cancer (NSCLC) and associated with distant metastasis (DM) while only the sputum microbiota was associated with non-DM NSCLC. The lung microbiota could therefore have a stronger association with (and thus may contribute more to) disease development than the gut microbiota. Mathematic models using both microbiotas performed better in patient stratification than using individual microbiota. Sputum models, however, performed similar to the combined models, suggesting a convenient, noninvasive diagnostic for NSCLC. Microbial biomarkers of distinct disease stages were mostly shared, suggesting that the same set of microbes were underlying disease progression, and the signals for distant metastasis could be acquired at early stages of the disease. Our results strongly support the feasibility of noninvasive diagnosis of NSCLC, including distant metastasis, are of clinical importance, and should warrant further research on the underlying molecular mechanisms.