Background: Air pollution, particularly from industrial sources like palm oil factories, poses a significant risk to respiratory health. This study aimed to investigate the impact of nitric oxide (NO) and carbon monoxide (CO) exposure on lung function in palm oil factory workers and compare it to the lung function of individuals in the surrounding community. Methods: A cross-sectional study was conducted in Kuantan Mudik District, Riau, Indonesia. One hundred palm oil factory workers with a minimum of two years of employment and 100 community members not occupationally exposed to NO and CO were recruited. Lung function was assessed using spirometry, and NO and CO levels were measured using specialized analyzers. Participants completed the European Community Respiratory Health Survey (ECRHS) questionnaire, and demographic and clinical data were collected. Statistical analyses included univariate, bivariate, and multivariate logistic regression. Results: Factory workers exhibited significantly higher levels of NO (p=0.000) and a higher prevalence of restrictive lung function (17%) compared to the community members (3%). Multivariate analysis identified NO exposure as the most significant risk factor for restrictive lung function (p=0.005). Each unit increase in NO was associated with a 1.12-fold increased risk of restrictive lung function. CO exposure, age, gender, smoking history, and the use of personal protective equipment (PPE) were not significantly associated with lung function impairment in this study. Conclusion: Occupational exposure to NO in palm oil factories is a significant risk factor for restrictive lung function impairment. Regular monitoring of NO levels and the implementation of effective control measures are crucial to protect the respiratory health of palm oil factory workers.