Thermal stimulus is an important environmental factor influencing animal behaviour. However, the mechanisms underlying thermosensation and thermal adaptation are poorly understood. The nematode Caenorhabditis elegans can sense a range of environmental temperatures and migrate towards the cultivation temperature on a thermal gradient. This modifiable thermotactic response provides an ideal system for studying the cellular and molecular processes involved in thermosensation and thermal information storage. We have identified neurons critical for thermotaxis by killing individual cells in live animals. The results indicate that an amphid sensory neuron, AFD, is a major thermosensory neuron. Some of the genetically defined cryophilic and thermophilic mutant phenotypes were mimicked when amphid interneurons AIY and AIZ, respectively, were killed, indicating that AIY is responsible for thermophilic movement and AIZ for cryophilic movement. We propose a neural model in which regulation of the activities of the two interneurons in opposite directions, depending on the cultivation temperature, is essential for thermotaxis.