Storm surges are unanticipated natural disturbances to mangrove forests, but little is known about how they alter ecosystem-level carbon dioxide exchange and methane flux of natural and restored mangrove forests. In this study, we quantified the impact of storm surge on CO2 and CH4 fluxes in natural (HK site) and restored (PYR site) mangroves, and analyzed the differences in the impact of environmental variables on CO2 and CH4 fluxes before, during, and after storm surges. The results showed that the intensity of carbon dioxide absorption was temporarily weakened at PYR site, while CO2 absorption even turned into CO2 source at HK site during the storm surge. The emission of CH4 was suppressed at both sites during the storm surge landfall. GPP, Reco, and CH4 emissions were reduced by 29% and 59%, 20% and 10%, and 50% and 40% at restored and natural mangroves, respectively, due to the storm surge. For the NEE at both sites, the most correlated environmental variable before, during, and after the storm surge was PPFD, with negative correlation coefficients of -0.89, -0.74, and -0.81, respectively. For PYR site, the correlations between FCH4 and VPD and RH both increased compared with those before and after the storm surge. For HK site, the correlations between FCH4 and VPD, RH, and TS during the storm surge were not significant, while the correlations between FCH4 and TS, WS, and PPFD were higher than those before and after the storm surge. These findings indicated that storm surges weaken CO2 absorption and inhibit methane emissions, and the carbon fluxes of natural and restored mangroves respond differently to storm surges. The research results can provide a basis for the study of mangrove carbon flux under extreme weather events.