Reduced risk of lung cancer among workers in the cotton textile industry has been observed since the 1970s. Bacterial endotoxin, a contaminant of raw cotton fiber and cotton dust, has been proposed as a protective agent that may act through the innate and acquired immune systems. We examine the association between endotoxin exposure and lung cancer risk in a cohort of female textile workers. We conducted a case-cohort study nested within a cohort of 267,400 female textile workers in Shanghai, China. We compared the cumulative exposure histories of 628 case patients diagnosed with incident lung cancer from January 1, 1989, through December 31, 1998, with those of a lung cancer-free reference subcohort of 3184 workers who were frequency matched by 5-year age-groups to all cancer patients in the cohort. Cumulative endotoxin exposure for all participants was based on historic measurements and on additional measurements for this study. Relative risks and 95% confidence intervals (CIs) were estimated by hazard ratios (HRs) from Cox proportional hazards models. We conducted exposure-response trend analyses by use of cumulative exposures with lag times of 0, 5, 10, 15, or 20 years to account for disease latency. All analyses controlled for age and smoking status. All statistical tests were two-sided. Cumulative exposure to endotoxin was strongly, statistically significantly, and inversely associated with lung cancer risk. The inverse trend was greatest with a 20-year lag time, for which highest endotoxin exposure was associated with a statistically significantly 40% less risk of lung cancer (HR = 0.60, 95% CI = 0.43 to 0.83; P(trend) across quintiles = .002) than non-exposure. From a reported population rate of lung cancer among women in Shanghai of 19.1 per 100,000 for the year 2000 and the estimated reduction in risk of lung cancer observed for 20 years of endotoxin exposure in this population of workers, the incidence of lung cancer in this cohort was reduced by approximately 7.6 per 100,000 (range = 3.2-10.9 per 100,000). Long-term and high-level exposure to endotoxin, compared with no exposure, appears to be associated with a reduced risk of lung cancer in this cohort.