Increasing forest pest (FP) hazards under climate change could eventually lead to tree mortality and reduce carbon sequestration, threatening forest health and sustainability of its ecosystem services. However, the impact of climate warming on national-scale FP occurrence remains a great challenge. This study aims to assess the spatiotemporal dynamics of FP occurrence and evaluate the contribution of historical climate change across China. Based on FP records from 1998 to 2019, we conducted temporal trend analysis and examined shifts in spatial centroids. Furthermore, we employed a hierarchical Bayesian model with Markov chain Monte Carlo method to quantify the effects of climate-related drivers. Our results show that while severe pest outbreaks have been largely controlled, the area affected by mild pest hazards has been gradually increasing. Additionally, a significant northward shift in the center of pest occurrences was observed (approximately 0.65° latitude per decade). Our hierarchical Bayesian model estimates that historical climate change contributed 48.0 ± 18.7% to pest occurrences, with temperature-related factors accounting for the majority. Notably, nighttime temperature variation had the largest positive contribution (27.4 ± 17.4%), whereas changes in daytime temperature had a spatially varied influence. Our findings indicate that climate warming, particularly nighttime warming, has driven the northward shift in FP occurrences, posing an increasingly severe threat to forest health in northern regions. These findings underscore the urgent need to address the risks posed by climate-induced FP hazards.