It remains unclear whether chronic obstructive pulmonary disease (COPD) is an independent risk factor for lung cancer after excluding confounding factors such as smoking, age, sex, body mass index (BMI), comorbidities, etc. Data from 11,440 participants (≥ 40 years old) in the National Health and Nutrition Examination Survey (NHANES) 2013-2018 were analyzed. Weighted multivariable logistic regression models were used to assess the association between COPD and lung cancer risk. Subgroup analyses were based on age, sex, BMI, and smoking. This study included 660 patients with COPD and 10,780 participants without COPD. The prevalence of lung cancer was significantly higher in patients with COPD compared to participants without COPD (3.39% vs 0.14%). After adjusting for confounding factors, COPD was associated with a significantly increased risk of lung cancer (OR, 12.24, 95% CI, 4.99-30.06, p < 0.001). This association remained significant in all subgroups, particularly in individuals aged > 65 years (OR, 20.05, 95% CI, 6.85-58.72, p < 0.001), smokers (OR, 19.38, 95% CI, 2.02-185.66, p = 0.010), males (OR, 17.39, 95% CI, 5.28-57.31, p < 0.001), individuals who quit smoking within 10 years (OR, 12.86, 95% CI, 2.59, 63.99, p = 0.002), and individuals with a BMI > 25 kg/m2 (OR, 14.56, 95% CI, 3.88-54.69, p < 0.001). COPD is an independent risk factor for lung cancer, especially in certain subgroups. The combination of COPD and smoking greatly amplifies the lung cancer risk. These findings highlight the importance of early lung cancer screening in patients with COPD.