Underground coal fires, which are widely distributed and cause serious resource waste and environmental hazards, have become a common concern of the international community. This paper aims to reveal the mechanism of coal spontaneous combustion and the expansion law of underground coal fires. A void rate model from the goaf to the ground surface and a multi-field coupling model for underground coal fires were established. Based on which, the combustion process from the beginning of oxidation to the formation of large-scale fire of the remaining coal in goaf was analyzed. Furthermore, the evolution law of underground coal fire after nitrogen injection and the influence of different nitrogen injection parameters were analyzed. The results show that the coal spontaneous combustion can be divided into three stages: slow reaction stage (stage Ⅰ), violent combustion stage (stage Ⅱ), and stable combustion stage (stage Ⅲ), and the transformation of different stages is mainly controlled by the oxidation reaction rate of coal. To obtain the optimal parameters for nitrogen injection for fire suppression, the fire extinguishing efficiency concerning nitrogen injection time, nitrogen injection amount and nitrogen injection position, as well as the distribution law of nitrogen in rock strata were analyzed. Through range analysis, it is determined that the most effective fire extinguishing occurs with the injection rate of 0.15 m3/s in stage I, and the injection position has little influence on the fire extinguishing effect. This understanding contributes to a deeper understanding of the multi-field coupling mechanism of underground coal fires and provides a guidance for extinguishing and preventing underground coal fires.