Both ambient air pollution and lifestyle factors contribute to the incidence of non-alcoholic fatty liver disease (NAFLD), but previous studies usually focused on single-factor associations. We aimed to assess the joint associations of ambient air pollution and lifestyle with the NAFLD risk and investigate whether lifestyle modifies the association of air pollution with NAFLD risk. A total of 417,025 participants from the UK Biobank were included in this study. Annual average concentrations of NO2, NOx, PM2.5, PM10, and PM2.5-10 were estimated. A composite lifestyle score was determined based on physical activity, alcohol intake, smoking status, dietary patterns, sedentary time, and sleep duration. Cox proportional hazards regression models were used to estimate the hazard ratios (HRs) and 95% confidence intervals (CIs), as well as the population attributable fraction (PAF). Potential additive interactions of air pollution with lifestyle were also examined by the relative excess risk due to the interaction (RERI) and the attributable proportion due to the interaction (AP). 4752 (1.14%) incident NAFLD events were recorded. Long-term exposure to air pollutants and an unhealthy lifestyle were significantly associated with the increased risk of incident NAFLD. Lifestyle was the primary factor of incident NAFLD, with a PAF of 37.18% (95% CI: 29.67%, 44.69%). In addition, a significant additive interaction between air pollution and lifestyle for NAFLD risk was observed (RERI: 0.36, 95%CI: 0.09-0.63). Long-term exposure to ambient air pollutants and poor lifestyle were jointly associated with a higher risk of NAFLD.