Most butterfly and moth larvae (Lepidoptera) are terrestrial. When terrestrial caterpillars accidentally fall into water, they may drown or be preyed upon by aquatic predators before they can safely reach land. However, how terrestrial caterpillars escape aquatic environments and predators remains unclear. In July 2018, we observed a terrestrial caterpillar actively moving forward on the surface of a pond in Japan until it successfully reached the shore. To further investigate this behaviour in terrestrial caterpillars, we experimentally placed larvae of 13 moth species (four families) on a water surface under laboratory and field conditions. All caterpillars floated. Larvae of seven species moved forward on the water surface, whereas those of six species did not. A total of two types of behaviour were observed; in Dinumma deponens, Hypopyra vespertilio, Spirama retorta, Laelia coenosa, Lymantria dispar (all Erebidae), and Naranga aenescens (Noctuidae), larvae swung their bodies rapidly from side to side to propel themselves along the water surface (i.e., undulatory behaviour); in contrast, larvae of Acosmetia biguttula (Noctuidae) rapidly moved the abdomen (posterior segments) up and down for propulsion along the water surface (i.e., flick behaviour). Although thoracic legs were not used for undulatory and flick behaviour, rapid movements of the abdomen were used to propel caterpillars on the water surface. We also observed that undulatory and flick behaviour on the water surface aided caterpillars in escaping aquatic predators under field conditions. In addition, we investigated the relationship between body size and undulatory behaviour on the water surface in the erebid S. retorta under laboratory conditions. The frequency and speed of forward movement on the water surface increased with body length. Together, these results show that the rapid movement of elongated bodies results in forward propulsion on the water surface, allowing some terrestrial caterpillars to avoid drowning or aquatic predators. We further suggested potential factors related to morphology, host plant habitat, and defensive behaviour that may have led to the acquisition of aquatic behaviour in terrestrial caterpillars.