During the process of coal spontaneous combustion (CSC), a plethora of combustible gases alongside inert gases, such as CO2, are copiously generated. However, prior investigations have regrettably overlooked the pivotal influence of inert gas production on the propensity for methane explosions during CSC. To investigate the impact of the flue gas environment generated by CSC, containing both combustible and inert gases, on the risk of methane explosion, a high-temperature programmed heating test system for CSC was employed to analyze the generation pattern of flue gas. It was found that CO, CO2, and CH4 were continuously generated in large quantities during the process of CSC, which are the main components of CSC flue gas. The effect of the concentration and component ratio (CCO2/CCO) of the flue gas on the methane explosion limit was tested. It was found that the CSC flue gas led to a decrease in the methane explosion limit, and that the explosion limit range was facilitated at 0 < CCO2/CCO < 0.543 and suppressed at CCO2/CCO > 0.543. As the temperature of CSC increases, the risk of methane explosion is initially suppressed. When the coal temperature exceeds 330~410 °C, the explosion risk rapidly expands.