Animals often must decide whether or not to consume a diet that contains competing attractive and aversive compounds. Here, using the fruit fly, Drosophila melanogaster, we describe a mechanism that influences this decision. Addition of bitter compounds to sucrose suppressed feeding behavior, and this inhibition depended on an odorant-binding protein (OBP) termed OBP49a. In wild-type flies, bitter compounds suppressed sucrose-induced action potentials, and the inhibition was impaired in Obp49a mutants. However, loss of OBP49a did not affect action potentials in sugar- or bitter-activated gustatory receptor neurons (GRNs) when the GRNs were presented with just one type of tastant. OBP49a was expressed in accessory cells and acted non-cell-autonomously to attenuate nerve firings in sugar-activated GRNs when bitter compounds were combined with sucrose. These findings demonstrate an unexpected role for an OBP in taste and identify a molecular player involved in the integration of opposing attractive and aversive gustatory inputs.