The temporal pairing of a neutral stimulus with a reinforcer (reward or punishment) can lead to classical conditioning, a simple form of learning in which the animal assigns a value (positive or negative) to the formerly neutral stimulus. Olfactory classical conditioning in Drosophila is a prime model for the analysis of the molecular and neuronal substrate of this type of learning and memory. Neuronal correlates of associative plasticity have been identified in several regions of the insect brain. In particular, the mushroom bodies have been shown to be necessary for aversive olfactory memory formation. However, little is known about which neurons mediate the reinforcing stimulus. Using functional optical imaging, we now show that dopaminergic projections to the mushroom-body lobes are weakly activated by odor stimuli but respond strongly to electric shocks. However, after one of two odors is paired several times with an electric shock, odor-evoked activity is significantly prolonged only for the "punished" odor. Whereas dopaminergic neurons mediate rewarding reinforcement in mammals, our data suggest a role for aversive reinforcement in Drosophila. However, the dopaminergic neurons' capability of mediating and predicting a reinforcing stimulus appears to be conserved between Drosophila and mammals.