Considerable evidence has demonstrated that transient receptor potential (TRP) channels play vital roles in sensory neurons, mediating responses to various environmental stimuli. In contrast, relatively little is known about how TRP channels exert their effects in the central nervous system to control complex behaviors. This is also true for the Drosophila TRP channel encoded by painless (pain). The Pain TRP channel is expressed in a subset of sensory neurons and involved in behavioral responses to thermal, chemical, and mechanical stimuli. Its physiological roles in brain neurons, however, remain largely elusive. Using multiple mutant alleles and tranformants for pain, here we demonstrate that the brain-expressed Pain TRP channel is required for long-term memory (LTM), but not for short-lasting memory, induced by courtship conditioning in adult males. The courtship LTM phenotype in pain mutants was rescued by expressing wild-type pain temporarily, prior to conditioning, in adult flies. In addition, targeted expression of painRNAi in either the mushroom bodies (MBs) or insulin-producing cells (IPCs) resulted in defective courtship LTM. These results indicate that the Pain TRP channels in the MBs and IPCs control neuronal plasticity that is required for the formation of a certain type of long-lasting associative memory in Drosophila.