Faced with the impact of climate risks, what responses do local governments make, particularly in the domain of social public policy? This study uses provincial panel data from China from 2009 to 2020 to investigate how climate risks affect local government education expenditure and its mechanisms. Analysis using spatial econometric models reveals the following. First, local climate risks significantly increase government education expenditure. This conclusion remains consistent across different proxy variables, model specifications, and estimation methods. Additionally, there is a spatial dependency on local government education expenditure, meaning that educational spending in neighboring areas positively influences the education expenditure of a specific location. Second, further mechanism analysis shows that climate risks lead to credit easing and drive the digital economic transformation of a location, thereby increasing its education expenditure. Third, considering the heterogeneity in the spatial dimension, it is found that this positive impetus exists only in the economically more developed eastern region. This study provides insights into understanding how the Chinese government responds to the impact of climate risks and its fiscal policy choices.