Temperature is an important environmental factor affecting heading date of rice. Despite its importance, genes responsible for temperature-sensitive heading in rice have remained elusive. Our previous study identified a quantitative trait locus qHd1 which advances heading date under high temperatures. A 9.5-kb insertion was found in the first intron of OsMADS51 in indica variety Zhenshan 97 (ZS97). However, the function of this natural variant in controlling temperature sensitivity has not been verified. In this study, we used CRISPR/Cas9 to knock out the 9.5-kb insertion in ZS97. Experiments conducted under cotrolled conditions in phytotrons confirmed that deletion increased temperature sensitivity and advanced heading by downregulating the expression level of OsMADS51. One-hybrid assays in yeast, ChIP-quantitative polymerase chain reaction, electrophoretic mobility shift, and luciferase-based transient transactivation assays collectively confirmed that OsMADS51 affects heading date by regulation of heading date gene Ehd1. We further determined that the long non-coding RNA HEATINR is generated from the first intron of OsMADS51, offering an explanation for how the 9.5-kb insertion affects temperature sensitivity. We also found that OsMADS51 was strongly selected in early/late-season rice varieties in South China, possibly accounting for their strong temperature sensitivity. These insights not only advance our understanding of the molecular mechanisms underlying the temperature-responsive regulation of heading date in rice but also provide a valuable genetic target for molecular breeding.