With geopolitical tensions rising, energy supply chain shortages emerging, and natural gas prices skyrocketing, dealing with geopolitical risk and ensuring energy security are attracting increasing attention from countries around the world, and the need for energy resilience has never been more urgent. To probe the causality between geopolitical risk and energy resilience, the paper establishes an energy resilience based on the panel data of 20 countries from 2000 to 2019 for empirical analysis. The results indicate that geopolitical risk improves energy resilience, and the conclusions still hold after a series of robustness tests. Moreover, this study also tests the underlying heterogeneity characteristics. To explore the influencing mechanism, this paper proposes that geopolitical risk has an impact on energy resilience through the scale effect, structural effect, and technological effect. Specifically, this paper concludes that geopolitical risk will not endanger energy resilience, which is mainly attributed to the fact that the dependence of countries on fossil energy for energy consumption hinders the negative effect of geopolitical risk on energy resilience. Finally, conclusions and policy implications are provided.