Cotton is the primary fibre crop in the world with high economic value, and its yield can be affected by climate and agronomic management. Xinjiang, the largest cotton-producing province in China, contributes to approximately 90 % of the national and over 20 % of global production. Earlier studies focused on cotton yield variability and/or drivers on the site scale, for only one to several counties or cities within Xinjiang, in several years before 2000, or provincial production for a short period. It remains poorly understood how and why cotton yields change in Xinjiang. This study analyzes the spatiotemporal variability of cotton yields at the provincial and county (73 counties) levels from 1989 to 2017 using yield statistics, and identifies the dominant climate and agronomic management factors as well as their optimal ranges, historical states, and interaction effects using the geographical detector method (Geodetector). The results show that the Xinjiang cotton yield has increased markedly over the past decades, with the long-term trend outweighing the interannual variability. High yields are mostly found in southern and northwestern Xinjiang. Yield has increased significantly in over 95.6 % of cotton-planting areas, primarily in the west. Nitrogen fertilization is the leading driver of cotton yield changes, mainly impacting long-term trends. The combination of nitrogen fertilization and agricultural mechanization enhances the explanatory power in a bivariate way and is the strongest in the interaction effect between factors. Temperature variability has the greatest influence on detrended yield variability, and the explanatory power is enhanced and the highest when combined with precipitation. In addition, historical states of these factors are generally lower than their optimal ranges, indicating potential for cotton yield enhancement through improved agronomic management practices and in the context of global warming. This study could enhance understanding of cotton Xinjiang yield variability and drivers, and provides scientific guidance for local cotton cultivation.