Previous studies point to the impact of energy market on carbon market under normal market conditions, but little is known about the impact under extreme market conditions. Motivated by these concerns, we aim to investigate the extreme risk spillovers to carbon markets from traditional fossil energy and new energy markets in China. After using copula model to obtain nonlinear tail dependence structure between carbon and energy markets, we compute conditional Value-at-Risk (CoVaR) to quantify extreme risk spillovers. The results indicate that (i) the risk spillovers from both traditional fossil energy and new energy markets to carbon markets are obviously larger when extreme events cause large shocks to energy markets; (ii) there are risks in the opposite direction in carbon markets when carbon-intensive energy markets are under extreme market conditions, but the direction of risks in carbon markets is uncertain when low-carbon energy markets are under extreme market conditions; (iii) the extreme risk spillovers to carbon markets from energy markets are regionally heterogeneous not only in magnitude but also in direction; (iv) energy markets prefer to transmit extreme risks to more liquid carbon markets. These new findings have valuable implications for both policymakers and participating enterprises in carbon markets.