Animals exhibit different behavioral responses to the same sensory cue depending on their internal state at a given moment. How and where in the brain are sensory inputs combined with state information to select an appropriate behavior? Here, we investigate how food deprivation affects olfactory behavior in Drosophila larvae. We find that certain odors repel well-fed animals but attract food-deprived animals and that feeding state flexibly alters neural processing in the first olfactory center, the antennal lobe. Hunger differentially modulates two output pathways required for opposing behavioral responses. Upon food deprivation, attraction-mediating uniglomerular projection neurons show elevated odor-evoked activity, whereas an aversion-mediating multiglomerular projection neuron receives odor-evoked inhibition. The switch between these two pathways is regulated by the lone serotonergic neuron in the antennal lobe, CSD. Our findings demonstrate how flexible behaviors can arise from state-dependent circuit dynamics in an early sensory processing center.