IntroductionAntimicrobial resistance (AMR) ofKlebsiella pneumoniae(K. pneumoniae) poses a significant global public health threat and is responsible for a high prevalence of infections and mortality. However, knowledge about how ambient temperature influences the AMR ofK. pneumoniaeis limited in the context of global warming.MethodsAMR data of 31 Chinese provinces was collected from the China Antimicrobial Resistance Surveillance System (CARSS) between 2014 and 2020. Socioeconomic and meteorological data were collected from the China Statistical Yearbook during the same period. A modified difference-in-differences (DID) approach was applied to estimate the association between ambient temperature and third-generation cephalosporin-resistantK. pneumoniae(3GCRKP) and carbapenem-resistantK. pneumoniae(CRKP). Furthermore, moderating effects of socioeconomic factors were also evaluated.ResultsEvery 1°C increase in annual average temperature was associated with a 4.7% (relative risk (RR):1.047, 95% confidence intervals (CI): 1.031–1.082) increase in the detection rate of 3GCRKP, and a 10.7% (RR:1.107, 95% CI: 1.011–1.211) increase in the detection rate of CRKP. The relationships between ambient temperature and 3GCRKP and CRKP were found to be moderated by socioeconomic status (GDPper capita, incomeper capita, and consumptionper capita; the interactionp-values <0.05), where higher economic status was found to strengthen the effects of temperature on the detection rate of 3GCRKP and weaken the effects on the detection rate of CRKP.DiscussionAmbient temperature was found to be positively associated with AMR ofK. pneumoniae, and this association was moderated by socioeconomic status. Policymakers should consider the impact of global warming and high temperatures on the spread of 3GCRKP and CRKP when developing strategies for the containment of AMR.