Functional optical imaging showed that odor or electric shock stimuli presented to the fly causes transient calcium influx into the two major axon branches of alpha/beta mushroom body (MB) neurons. One pairing of odor and electric shock stimuli or multiple, massed pairings did not alter odor-evoked calcium influx. In contrast, animals that received multiple, spaced pairings exhibited a robust increase in calcium influx into the MB axons when tested at 9 or 24 hr after training, but not at 3 hr. This modification occurred only in the alpha branch of the neurons and was blocked by mutation of the amnesiac gene, inhibition of protein synthesis, or the expression of a protein blocker of the transcription factor Creb. Thus, behavioral long-term olfactory memory appears to be encoded as a branch-specific modification of calcium influx into the alpha/beta MB neurons that occurs after spaced training in a protein synthesis-, Creb-, and amnesiac-dependent way.