Using functional optical imaging in vivo, we demonstrate that the γ mushroom body (MB) neurons of Drosophila melanogaster respond with axonal calcium influx when odors or electric shock stimuli are presented to the fly. Pairing of odor and electric shock stimuli in a single training trial or multiple, massed training trials failed to modify the odor-evoked calcium signal when flies were tested at several different times after training. In contrast, animals that received multiple but spaced odor-shock pairings exhibited a robust increase in calcium influx into the MB axons when tested between 18 and 48 h after training. This time window for the γ neuron memory trace is displaced relative to the modifications that occur between 9 and 24 h after training in the α branch of the α/β MB neurons. The α/β and the γ neuron long-term memory traces were both blocked by expressing a repressor of the transcription factor cAMP response element-binding protein or a calcium/calmodulin-dependent kinase II hairpin RNA. These results demonstrate that behavioral long-term olfactory memory is encoded as modifications of calcium influx into distinct MB neurons during overlapping but different windows of time after training.