The nationwide occurrence of endosulfan residues in cotton fields has not yet been investigated. Therefore, in this study, 202 surface soil samples from 27 cities were collected from cotton fields in 8 major cotton-planting provinces of China, covering more than 97% of the national cotton sown area. The results showed that endo-sulfan residues were detected in cotton fields throughout the country. The main type of residue found was endosulfan sulfate (ES-sulfate), followed by beta-endosulfan and alpha-endosulfan, with average concentrations of 0.475, 0.129, and 0.048 mu g/kg, respectively. Significant spatial variations in the endosulfan residues was noted, and the highest concentration of endosulfan residues was observed in the northwest inland cotton-growing area, followed by that in the Yellow River basin and Yangtze River basin cotton-growing areas. The endosulfan res-idues showed significant positive correlations with soil organic matter and soil clay contents. The alpha/beta endosulfan ratio was determined to be in the range of 0.02-1.20, indicating that endosulfan residues originated from the endosulfan application performed in historical cotton cultivation efforts. Together with the literature data, the concentrations of alpha-endosulfan and beta-endosulfan residues peaked in 2015 and 2017, respectively, and showed an overall decreasing trend from 2002 to 2021. The results of the ecological risk assessment suggested that Folsomia candida was most sensitive to endosulfan residues, with 20.8% of the sites presenting a high risk. However, in general, the soil ecological risk of cotton fields across the country was low. Our study demonstrated that China has achieved promising results in controlling the use and pollution of endosulfan, especially after 2014.