Avoidance of noxious ambient heat is crucial for survival. A well-known phenomenon is that animals are sensitive to the rate of temperature change. However, the cellular and molecular underpinnings through which animals sense and respond much more vigorously to fast temperature changes are unknown. Using Drosophila larvae, we found that nociceptive rolling behavior was triggered at lower temperatures and at higher frequencies when the temperature increased rapidly. We identified neurons in the brain that were sensitive to the speed of the temperature increase rather than just to the absolute temperature. These cellular and behavioral responses depended on the TRPA1 channel, whose activity responded to the rate of temperature increase. We propose that larvae use low-threshold sensors in the brain to monitor rapid temperature increases as a protective alert signal to trigger rolling behaviors, allowing fast escape before the temperature of the brain rises to dangerous levels.