Caffeine (1,3,7-trimethylxanthine) is derived from xanthosine through three successive transfers of methyl groups and a single ribose removal in coffee plants. The methyl group transfer is catalyzed by N-zmethyltransferases, xanthosine methyltransferase (XMT), 7-methylxanthine methyltransferase (MXMT) and 3,7-dimethylxanthine methyltransferase (DXMT). We previously cloned three genes encoding each of these N-methyltransferases from coffee plants, and reconstituted the final sequence of the caffeine synthetic pathway in vitro. In the present study, we simultaneously expressed these coffee genes in tobacco plants (Nicotiana tabacum), using a multiple-gene transfer method, and confirmed successful caffeine production up to 5 μg g−1 fresh weight in leaves of the resulting transgenic plants. Their effects on feeding behavior of tobacco cutworms (Spodoptera litura), which damage a wide range of crops, were then examined. Leaf disc choice test showed that caterpillars selectively fed on the wild-type control materials, or positively avoided the transgenic materials. The results suggest a novel approach to confer self-defense by producing caffeine in planta. A second generation of transgenic crops containing caffeine may save labor and agricultural costs and also mitigate the environmental load of pesticides in future.