Innate chemosensory preferences are often encoded by sensory neurons that are specialized for attractive or avoidance behaviors. Here, we show that one olfactory neuron in Caenorhabditis elegans, AWC(ON), has the potential to direct both attraction and repulsion. Attraction, the typical AWC(ON) behavior, requires a receptor-like guanylate cyclase GCY-28 that acts in adults and localizes to AWC(ON) axons. gcy-28 mutants avoid AWC(ON)-sensed odors; they have normal odor-evoked calcium responses in AWC(ON) but reversed turning biases in odor gradients. In addition to gcy-28, a diacylglycerol/protein kinase C pathway that regulates neurotransmission switches AWC(ON) odor preferences. A behavioral switch in AWC(ON) may be part of normal olfactory plasticity, as odor conditioning can induce odor avoidance in wild-type animals. Genetic interactions, acute rescue, and calcium imaging suggest that the behavioral reversal results from presynaptic changes in AWC(ON). These results suggest that alternative modes of neurotransmission can couple one sensory neuron to opposite behavioral outputs.